Professional Documents
Culture Documents
Lecture 2
HTML
Stands for Hyper Text Markup Language
With HTML you can create your own websites.
HTML is derived from a language SGML(Standard
Graphic Markup Language)
HTML is a markup language.
A Markup Language is a set of markup tags.
HTML uses markup tags to describe web pages.
HTML is not case sensitive language.
Tags In HTML
HTML tags are keywords (tag names) surrounded
by angle brackets< >
<tagname> content </tagname>
HTML tags normally come in pairs
<p> and </p>
Start Tag= First Tag-----also called opening tag.
End tag = Second tag----also called closing tag.
The end tag is written like the start tag, but with a
slash before the tag name
HTML Elements
</head>
<body>
</body>
</html>
HTML Document Basics
All HTML documents must start with a type
declaration: <!DOCTYPE html>.
The visible part of the HTML document is between
<body> and </body>.
<!DOCTYPE> Declaration
HTML5
<!DOCTYPE html>
HTML 4.01
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Description Of Tags
The DOCTYPE declaration defines the document type to be HTML.
To display a document correctly, the browser must know both type
and version.
The <!DOCTYPE> declaration helps the browser to display a web
page correctly.
The text between <html> and </html> describes an HTML
document
The text between <head> and </head> provides information
about the document
The text between <title> and </title> provides a title for the
document
The text between <body> and </body> describes the visible page
content
Tiltle
HTML Paragraph Tag
HTML documents can be divided into paragraphs.
HTML paragraphs are defined with the <p> tag
Usually start and end tag is used<P> and </P>
But </P> is optional
Paragraph tag does not print break lines.
Use <BR> for blank line
Paragraph Tag
<!DOCTYPE html>
<html>
<head>
<title>Responsive Layout</title>
</head>
<body>
<p>
This is a paragraph .We are learning HTML Tags
</p>.
</body>
</html>
Paragraph Tag
<!DOCTYPE html>
<html>
<head>
<title>Responsive Layout</title>
</head>
<body>
<p> This is a paragraph .We are learning HTML Tags .
It is the second line.
It is the third line.
</p>.
</body>
</html>
Paragraph
Heading Tag
HTML headings are defined with the <h1> to
<h6> tags:
All the six headings require the closing tag.
<H1> this is h1 </H1> -- largest of the six
<H2> this is h2 </H2>
</body>
</html>
HTML Text Color
The color property defines the text color to be used for
an HTML element.
<body style="background-color:yellow">
<h1 style="color:blue">This is a heading1</h1>
<hr>
<h2 style="color:red">This is a heading2</h2> <hr>
<p>This is a paragraph.</p>
</body>
HTML Fonts
The font-family property defines the font to be
used for an HTML element:
<h1 style="font-family:verdana">This is a
heading</h1>
<p style="font-family:courier">This is a
paragraph.</p>
HTML Text Size
The font-size property defines the text size to be
used for an HTML element:
<h1 style="font-size:300%">This is a
heading</h1>
<p style="font-size:160%">This is a
paragraph.</p>
HTML Text Alignment
The text-align property defines the horizontal text
alignment for an HTML element:
<h1 style="text-align:center">Centered
Heading</h1>
<p>This is a paragraph.</p>
Anchor Tag /Hyperlink Tag
<a> is used to define a hyperlink.
<a href="www.google.com"><b>This is a
link</b>
</a>
<p>This is a paragraph.</p>
Text Formatting Tags
<b> Defines bold Text
<em>Define emphasized text
<i>Define italic text
<small>Defines small text
<strong>Defines strong text
<mark>Defines marked or highlighted text
<del>Defines deleted text
<sub>Defines subscripted text
Text Formatting Tags
<h2> <b>This is a bold text.</b></h2>
<h2><i>This is italic text<i></h2>
<h2>x<sub>2</sub><sup>3</sup>