HTML 1
HTML 1
HTML 1
HTML syntax:
Single or one-sided tag:
<tag />
e.g. Breaking line tag: <br/>
Horizontal line tag: <hr/>
Structure of the web page
Inside the <html></html> tag
Each web page has a body part described in <body></body>
tag:
<html> The content of
<head> the whole web
<title> My Web Page </title> page should be
</head> put here
<body>
This is a sample HTML file.
</body>
</html>
BODY ELEMENT
The BODY element of a web page is an important
element in regards to the page’s appearance.
Attributes of body tag are:
• Bgcolor: Sets the background color.
• Background: Sets the background image.
• Text: Sets the color for the text in body.
• Top margin: Sets the margin(space) from the top.
COMMENT TAG
This tag is used to write comments, user
can write the description.
This tag has no effect on content of the
web page shown on the viewer’s browser
Eg:
<!My description>
BASIC TAGS
HEADING TAG
<h1>…</h1> to <h6>…</h6>.
H1 specifies highest level of heading (size of text is biggest)
whereas H6 specifies lowest level of heading ( size of text is
smallest).
Headings, <Hx> </Hx>
<HTML> Heading 1
<HEAD> Heading 2
<TITLE> Example Heading 3
Page</TITLE>
Heading 4
</HEAD> Heading 5
<BODY> Heading 6
– Ordered list
1. Numbered items
– Definition List
• a list of items, with a description of each item
Unordered Lists
in HTML
• The tag for a bulleted list is <ul> & </ul>
• Each item is surrounded with the open and close
<li> tag (li = list item)
• Bullets can be changed to squares or circles with the
optional code type=“square” or type=”circle” in the
<ul> tag.
– Code View -- Browser View
<ul >
<li>Milk</li> • Milk
<li>Eggs</li> • Eggs
</ul>
Ordered Lists
in HTML
• The tag for a numbered list is <ol> & </ol>
• Each item is surrounded with the open and close
<li> tag (li = list item)
• List items will be numbered
• Numbers can be changed to a, A, i, or I with the optional code
type=“a”, type=“A”, etc in the <ol> tag.
– Code View
<ol > -- Browser View
<li>George Washington</li> 1. George Washington
<li>John Adams</li> 2. Johns Adam
</ol>
Another way to define style types:
• <ol type =“i“> </ol>
Value for type attribute Description Examples
a Small Letters a, b, c, d, e
<a href="http://www.facebook.com/">Here
is a link to Facebook.com</a>
In the example the attribute href has the value
"http://www.facebook.com", which is the full
address of Facebook and is called a URL
(Uniform Resource Locator).