3. INTRODUCTION
• HTML is the standard markup
language for creating Web pages.
• HTML stands for Hyper Text Markup Language
• HTML describes the structure of a Web page
• HTML consists of a series of elements
• HTML elements tell the browser how to display
the content
• HTML elements are represented by tags
• Browsers do not display the HTML tags, but use
them to render the content of the page
5. ELEMENTS AND ATTRIBUTES
An HTML element usually consists of a start
tag and an end tag, with the content
inserted in between:
<tagname>Content goes here...</tagname>
6. Nested HTML Elements
• HTML elements can be nested (elements can contain
elements).
• All HTML documents consist of nested HTML elements.
• Example:
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
7. Empty HTML Elements
• HTML elements with no content are called
empty elements.
• Example:
<br> is an empty element without a closing tag
8. HTML Attributes
• All HTML elements can have attributes
• Attributes provide additional information
about an element
• Attributes are always specified in the start tag
• Attributes usually come in name/value pairs
like: name="value“
• Example: <body bgcolor=“red”>
9. HTML TAGS
• Basic HTML
Tag Description
<!DOCTYPE> Defines the document type
<html> Defines an HTML document
<head>
Defines information about the
document
<title> Defines a title for the document
<body> Defines the document's body
10. <h1> to <h6> Defines HTML headings
<p> Defines a paragraph
<br> Inserts a single line break
<hr>
Defines a thematic change in the
content
<!--...--> Defines a comment
<font> Defines font, color, and size for text
14. <b> Defines bold text
<center> Defines centered text
<strong> Defines important text
<i>
Defines a part of text in an alternate voice or
mood
<strike> Defines strikethrough text
<em> Defines emphasized text
<sub> Defines subscripted text
<sup> Defines superscripted text
18. Reserved Characters in HTML
Character Description
" Quotation Mark
' Apostrophe
& Ampersand
< Lesser than
> Greater than
19. Image tag
• <img> Defines an image
• Attributes:
Attribute Function
Src Identify the location of the image
Align Specify the alignment of the image ( left, right, top and
bottom)
Border To give a border
Height To specify the height
Width To specify the width
Alt To place a pointer text
23. Lists in HTML
Tag Description
<ul> Defines an unordered list
<ol> Defines an ordered list
<li> Defines a list item
<dir>
Not supported in HTML5. Use <ul>
instead.
Defines a directory list
<dl> Defines a description list
<dt> Defines a term/name in a description list
<dd>
Defines a description of a term/name in a
description list
24.
25.
26.
27. Anchor Tag
• The <a> tag defines a hyperlink, which is used
to link from one page to another.
• Indicates the link's destination.
• By default, links will appear as follows in all
browsers:
An unvisited link is underlined and blue
A visited link is underlined and purple
An active link is underlined and red
28. Attribute name Values Notes
hreflang
Specifies the language of the
linked resource.
download
Directs the browser to
download the linked resource
rather than opening it.
target
_blank
_parent
_self
_top
frame name
Specifies the context in which
the linked resource will open.
title text
Defines the title of a link,
which appears to the user as a
tooltip.
href url
Specifies the linked document,
resource, or location.
name
35. Table Tags
• The <table> tag defines an HTML table
• Elements
Tag Description
<table> Defines a table
<th> Defines a header cell in a table
<tr> Defines a row in a table
<td> Defines a cell in a table
<thead> Groups the header content in a table
39. Marquee
• The <marquee> is a non-standard HTML tag
which was used to create a scrolling text or an
image.
• It was used to make the text/image scroll
horizontally across or vertically down the web
page.
40. Attributes
Attribute Value Description
behavior
scroll
slide
alternate
Defines the scrolling type.
bgcolor
rgb(x,x,x)
#xxxxxx
colorname
Is used to give a background color.
direction
up
down
left
right
Sets the direction for the scrolling
content.
height
pixels
%
Defines the marquee's height.
width
pixels
%
Defines the marquee's width.