Lesson1-Intro To HTML
Lesson1-Intro To HTML
Lesson1-Intro To HTML
2
Our First Example
4
Tag Attributes
5
HTML Document Structure
Body
Enclosed within <body> and </body>
Within the body, content is to be displayed
Other tags can be embedded in the body
6
We’ll Study…
HTML Basics
(http://www.w3schools.com/html/html_intro.asp):
HTML Elements
HTML Headings
HTML Paragraphs
HTML Formatting
HTML Styles
HTML Images
HTML Tables
HTML Lists
HTML Forms
HTML Colors
7
Headings, Paragraphs,
Breaks & Horizontal Rules
In this chapter you will add headings to your page, insert
paragraphs, add some breaks, and add horizontal
rules.
Objectives
Upon completing this section, you should be able to
1. List and describe the different Heading elements.
2. Use Paragraphs to add text to a document.
3. Insert breaks where necessary.
4. Add a Horizontal Rule.
8
Headings, <Hx> </Hx>
9
Headings, <Hx> </Hx>
10
Paragraphs, <P> </P>
11
Paragraphs, <P> </P>
12
Break, <BR>
13
Break, <BR>
14
Horizontal Rule, <HR>
15
Colors
16
Colors
17
Color Codes
18
The Body Element
19
Background Color
20
TEXT Color
21
Character Formatting
In this chapter you will learn how to enhance your page with Bold, Italics,
and other character formatting options.
Objectives
Upon completing this section, you should be able to
Change the color and size of your text.
Use Common Character Formatting Elements.
Align your text.
Add special characters.
Use other character formatting elements.
22
Bold, Italic and other Character
Formatting Elements
<FONT SIZE=“+2”> Two sizes bigger</FONT>
The size attribute can be set as an absolute value from 1 to 7 or as a relative
value using the “+” or “-” sign. Normal text size is 3 (from -2 to +4).
<B> Bold </B>
<I> Italic </I>
<U> Underline </U>
Color = “#RRGGBB” The COLOR attribute of the FONT element. E.g., <FONT
COLOR=“#RRGGBB”>this text has color</FONT>
<PRE> Preformatted </PRE> Text enclosed by PRE tags is displayed in a mono-
spaced font. Spaces and line breaks are supported without additional elements
or special characters.
23
Bold, Italic and other Character
Formatting Elements
24
Alignment
25
Lists
26
List Elements
You have the choice of three bullet types: disc(default), circle, square.
These are controlled in Netscape Navigator by the “TYPE” attribute for the
<UL> element.
<UL TYPE=“square”>
<LI> List item …</LI>
<LI> List item …</LI>
<LI> List item …</LI>
</UL>
List item …
List item …
List item …
27
Links
28
More Links
29
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>
30
Adding Images
31
Adding Images
32
Images
Width (WIDTH): is the width of the image in pixels.
Height (HEIGHT): is the height of the image in pixels.
Border (BORDER): is for a border around the image, specified in pixels.
HSPACE: is for Horizontal Space on both sides of the image specified in
pixels. A setting of 5 will put 5 pixels of invisible space on both sides of the
image.
VSPACE: is for Vertical Space on top and bottom of the image specified in
pixels. A setting of 5 will put 5 pixels of invisible space above and bellow
the image.
33
Images as Links
You can also href an image the same way you would
with text, by including the <image src=“sample.jpeg> in
place of the text between the href anchors.
For example: <a href=“www.catabus.com”><image
src=“sample.jpeg></a>
Or, you could have “mailto:[email protected]” in place of
the website.
34
Using Image Background
<BODY BACKGROUND=“hi.gif”
BGCOLOR=“#FFFFFF”></BODY>
35
Tables
In this chapter you will learn that tables have many uses in
HTML.
Objectives:
Upon completing this section, you should be able to:
1. Insert a table.
2. Explain a table’s attributes.
3. Edit a table.
4. Add a table header.
36
TABLES
37
TABLES
<table border=“1”>
<tr>
<th> Column 1 header </th>
<th> Column 2 header </th>
</tr>
<tr>
<td> Row1, Col1 </td>
<td> Row1, Col2 </td>
</tr>
<tr>
<td> Row2, Col1 </td>
<td> Row2, Col2 </td>
</tr> 38
</table>
Tables Attributes
39
Tables Attributes
40
Table Data and Table Header
Attributes
Colspan: Specifies how many cell columns of the table this cell should span.
Rowspan: Specifies how many cell rows of the table this cell should span.
Align: cell data can have left, right, or center alignment.
Valign: cell data can have top, middle, or bottom alignment.
Width: you can specify the width as an absolute number of pixels or a
percentage of the document width.
Height: You can specify the height as an absolute number of pixels or a
percentage of the document height
41
Forms
Forms add the ability to web pages to not only provide the person viewing
the document with dynamic information but also to obtain information
from the person viewing it, and process the information.
Objectives:
Upon completing this section, you should be able to
1. Create a FORM.
2. Add elements to a FORM.
3. Define CGI (Common Gateway Interface).
4. Describe the purpose of a CGI Application.
5. Specify an action for the FORM.
Forms work in all browsers.
Forms are Platform Independent.
42
Forms
43
Form Elements
44
Form Elements
45
Text Box
46
Example on Text Box
<TITLE>Form_Text_Type</TITLE>
</HEAD> <BODY>
<h1> <font color=blue>Please enter the following bioData</font></h1>
<FORM name="fome1" Method= " get " Action= " URL " >
First Name: <INPUT TYPE="TEXT" NAME="FName"
SIZE="15" MAXLENGTH="25"><BR>
Last Name: <INPUT TYPE="TEXT" NAME="LName"
SIZE="15" MAXLENGTH="25"><BR>
Nationality: <INPUT TYPE="TEXT" NAME="Country"
SIZE="25" MAXLENGTH="25"><BR>
The Phone Number: <INPUT TYPE="TEXT" NAME="Phone"
SIZE="15" MAXLENGTH="12"><BR>
</FORM> </BODY> </HTML>
47
Password
48
Password example
<HTML><HEAD>
<TITLE>Form_Password_Type</TITLE></HEAD>
<BODY>
<h1> <font color=red>To Access, Please
enter:</font></h1>
<FORM name="fome2" Action="url" method="get">
User Name: <INPUT TYPE="TEXT" Name="FName"
SIZE="15" MAXLENGTH="25"><BR>
Password: <INPUT TYPE="PASSWORD"
NAME="PWord" value="" SIZE="15”
MAXLENGTH="25"><BR>
</FORM></BODY> </HTML>
49
Check Box
50
CHECKBOX EXAMPLE
51
Radio Button
52
RADIOBUTTON EXAMPLE
53
Submit Button
54
SUBMIT BUTTON EXAMPLE
55
EXERCISE
56
END
57