�Introduction to� HTML .�
1
Definitions
HTML is a text formatting language.
2
3
Tags
4
Words to remember
<TITLE>My Web Page</TITLE>
<TITLE> = <title> = <TITLE>
5
HTML Page Creation & Editing
In this chapter you will learn to create HTML
pages with a standard text editor.
Objectives
Upon completing this section, you should be able to
1. Choose a Text Editor.
2. Create a Basic Starting Document.
3. Understand and set Document Properties.
4. View Your Results in a Browser.
6
Creating a Basic Starting Document
<HTML>
<HEAD>
<TITLE>GNDU Amritsar</TITLE>
</HEAD>
<BODY>
This is what is displayed.
</BODY>
</HTML>
7
Creating a Basic Starting Document
8
Setting Document Properties
9
Color Codes
10
Color Codes
11
The Body Element
TEXT="#RRGGBB" to change the color of all the text on the page (full page text color.)
12
Background Color
<BODY BGCOLOR=“#FFFFFF”></BODY>
13
TEXT Color
<BODY BGCOLOR=“#FFFFFF” TEXT=“#FF0000”></BODY>
In this example the document’s page
color is white and the text would be red.
14
LINK, VLINK, and ALINK
These attributes control the colors of the different link states:
1. LINK – initial appearance – default = Blue.
2. VLINK – visited link – default = Purple.
3. ALINK –active link being clicked–default= Yellow.
The Format for setting these attributes is:
<BODY BGCOLOR=“#FFFFFF” TEXT=“#FF0000” LINK=“#0000FF”
VLINK=“#FF00FF”
ALINK=“FFFF00”> </BODY>
15
Using Image Background
<BODY BACKGROUND=“hi.gif” BGCOLOR=“#FFFFFF”></BODY>
16
Headings, <Hx> </Hx>
17
Headings, <Hx> </Hx>
<HTML>
<HEAD>
<TITLE> Example Page</TITLE>
</HEAD>
<BODY>
<H1> Heading 1 </H1>
<H2> Heading 2 </H2>
<H3> Heading 3 </H3>
<H4> Heading 4 </H4>
<H5> Heading 5 </H5>
<H6> Heading 6 </H6>
</BODY>
</HTML>
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
18
Paragraphs, <P> </P>
19
Break, <BR>
20
Break, <BR>
<HTML>
<HEAD>
<TITLE> Example Page</TITLE>
</HEAD>
<BODY>
<H1> Heading 1 </H1>
<P>Paragraph 1, <BR>
Line 2 <BR> Line 3 <BR>….
</P>
</BODY>
</HTML>
Heading 1
Paragraph 1,….
Line 2
Line 3
….
21
Horizontal Rule, <HR>
22
Horizontal Rule, <HR>
23
Attribute | Description | Default Value |
SIZE | Height of the rule in pixels | 2 pixels |
WIDTH | Width of the rule in pixels or percentage of screen width | 100% |
NOSHADE | Draw the rule with a flat look instead of a 3D look | Not set (3D look) |
ALIGN | Aligns the line (Left, Center, Right) | Center |
COLOR | Sets a color for the rule (IE 3.0 or later) | Not set |
Horizontal Rule, <HR>
<HTML>
<HEAD>
<TITLE> Example Page</TITLE>
</HEAD>
<BODY>
<H1> Heading 1 </H1>
<P>Paragraph 1, <BR>
Line 2 <BR>
<HR>Line 3 <BR>
</P>
</BODY>
</HTML>
Heading 1
Paragraph 1,….
Line 2
___________________________
Line 3
24
Bold, Italic and other Character Formatting Elements
25
Bold, Italic and other Character Formatting Elements
26
Bold, Italic and other Character Formatting Elements
<P> <FONT SIZE=“+1”> One Size Larger </FONT> - Normal –
<FONT SIZE=“-1”> One Size Smaller </FONT> <BR>
<B> Bold</B> - <I> italics</I> - <U> Underlined </U> -
<FONT COLOR=“#FF0000”> Colored </FONT> <BR>
<EM> Emphasized</EM> - <STRONG> Strong </STRONG> - <TT> Tele Type </TT> <BR>
One Size Larger - Normal – One Size Smaller �Bold - italics - Underlined - Colored �Emphasized - Strong - Tele Type �
27
Alignment
28
Alignment
29