CSE326 Unit1
CSE326 Unit1
Internet Programming
Laboratory
Lecture #1
Parveen Kaur
1
2
Outline
●Introduction
●HTML Document structure
●Types of tags
●Headings
●Paragraphs
●HTML main tag
●Comments
3
Introduction
●HTML stands for Hyper Text Markup Language.
●It is a markup language.
●It is the basic building block of World Wide Web.
●It describes the structure of a web page.
●It consists of a series of elements.
●HTML was originally developed by Tim Berners-Lee in
1990. He is also known as the father of the web.
●HTML5 is the latest version of HTML.
4
Introduction
Parveen Kaur, Lovely
Professional University
structure
●A markup tag is composed of a keyword surrounded
by angle brackets.
<tag_name></tag_name>
<html>
<head>
<title>…</title>
</head>
<body>
……..
</body>
</html>
6
<!DOCTYPE html>
●This is a special declaration that helps the browser display
the page correctly by telling it the type of code we’re
writing (in this case it’s HTML5).
●It should appear once at the start of the document before
any other elements.
●This is a special element that doesn’t require a closing tag.
●This ensures that the web page is parsed the same way by
different web browsers.
<!DOCTYPE html>
7
Types of tags
●Paired tags
○If any html tag has a separate opening and a
separate closing tag, then such html tag is known
as paired tag.
○<h1>content</h1>
●Unpaired tags
○If any html tag has both opening and closing tag in
a single tag, then such html tag is known as
unpaired tag.
○<br>, <hr>
Parveen Kaur, Lovely 8
Element
●An element in HTML usually consist of a start tag <tag
name>, close tag </tag name> and content inserted
between them.
○Technically, an element is a collection of start tag,
attributes, end tag, content between them.
○ <h1>This is my first web page</h1>
●Void element: Elements does not have content and end
tag are known as Void elements or empty elements.
○These elements are also called as unpaired tag.
○<h1>This is my first <br> web page</h1>
●Nested HTML Elements: HTML can be nested, which
means an element can contain another element.
Parveen Kaur, Lovely
Professional University 10
Element
● For the default display and styling purpose in HTML, all the elements
are divided into two categories as: Block-level element and Inline
element.
● Block-level elements:
○ Provides structure of main part of web page, by dividing a page
into coherent blocks.
○ Always start with new line and takes the full width of web page,
from left to right.
○ <address>, <article>, <aside>, <blockquote>, <canvas>,
<dd>, <div>, <dl>, <dt>, <fieldset>, <figcaption>, <figure>,
<footer>, <form>, <h1>-<h6>, <header>, <hr>, <li>, <main>,
<nav>, <noscript>, <ol>, <output>, <p>, <pre>, <section>,
<table>, <tfoot>, <ul> and <video>.
Parveen Kaur, Lovely
Professional University 11
Element
●Inline elements:
○Differentiate the part of a given text and provide it a particular
function.
○Does not start with new line and take width as per requirement.
○The Inline elements are mostly used with other elements.
○<a>, <abbr>, <acronym>, <b>, <bdo>, <big>, <br>,
<button>, <cite>, <code>, <dfn>, <em>, <i>, <img>,
<input>, <kbd>, <label>, <map>, <object>, <q>, <samp>,
<script>, <select>, <small>, <span>, <strong>, <sub>,
<sup>, <textarea>, <time>, <tt>, <var>.
○<a href="https://www.javatpoint.com/html-tutorial">Click on
link</a>
Parveen Kaur, Lovely
Professional University 12
Tag:
●Any text written inside the angle brackets is a tag.
○<></>
●The text inside the angle brackets is just used to tell the browser
how to display or transform regular text located between the
opening tag and the closing tag.
Element:
●An element is an opening tag, a closing tag, and all the content
that is included between the two tags.
○<tag attribute=“”></tag >
Parveen Kaur, Lovely
Professional University 13
Root
●The <html> HTML element represents the root (top-level element)
of an HTML document, so it is also referred to as the root element.
All other elements must be descendants of this element.
<html>
<head>
<title>…</title>
</head>
<body>
……..
</body>
</html>
Parveen Kaur, Lovely
Professional University 14
Metadata
●Metadata is data (information) about data.
●Meta tags are used in html for metadata.
●<meta> tags always go inside the <head> element, and are
typically used to specify character set, page description, keywords,
author of the document, and viewport settings.
●Metadata will not be displayed on the page, but is machine
parsable.
●Metadata is used by browsers (how to display content or reload
page), search engines (keywords), and other web services.
<head>
<meta charset="UTF-8">
Horizontal Rules
●The <hr> tag defines a thematic break in an HTML page.
●It is also called as the horizontal rule.
○<hr>
<html>
<body>
<h1>An example of the hr tag in HTML</h1>
<hr>
<p>Welcome to the page.</p>
<hr>
<p>Below are the contents.</p>
</body>
</html>
Parveen Kaur, Lovely
Professional University 16
Line Breaks
●The <br> tag inserts a single line break.
○<br>
●It is generally used in poem or address where the division of
line is necessary
<html>
<body>
<h1>An example of the hr tag in HTML</h1>
<p>Welcome to the page <br> here is the
line break.</p>
<p>Below are the contents.</p>
</body>
</html>
Parveen Kaur, Lovely 17
Professional University
Citation
● The <cite> HTML element is used to mark up the title of a cited
creative work.
○ A book
○ A research paper
○ An essay
○ A poem
○ A musical score
○ A song
Quotation
●The Quotation elements in HTML are used to insert quoted
texts in a web page, that is the portion of texts different
from the normal texts in the web page.
Definition
●The <dfn> tag stands for the "definition element", and it
specifies a term that is going to be defined within the
content.
●The nearest parent of the <dfn> tag must also contain the
definition/explanation for the term.
○<p><dfn>HTML</dfn> is the standard markup
language for creating web pages.</p>
21
●Comments
●Comments are some text or code written in your code to
give an explanation about the code.
●Comments are not visible to the user.
●Anything written between these tags will be ignored by the
browser.
○ <!-- This is a comment -->
22
References
● https://www.w3schools.com/html/html_headings.asp
● https://www.w3schools.com/tags/tag_p.asp
● https://www.w3schools.com/tags/tag_main.asp
● https://www.w3schools.com/tags/tag_comment.asp#:~:text=HTML%20Tag&text=T
he%20comment%20tag%20is%20used,code%20at%20a%20later%20date
.
23
Thank you