HTML-lesson
HTML-lesson
COLLEGE
200 Dolores St. Arnaiz Ave. Pasay City
-
HTML & XHTML
HTML & XHTML has its own rules for web authors or web developers to
follow and is referred to web standards.
URL
Uniform Resources Locator (URL) is a unique address for a file that
resides on the Internet. URL is commonly known when a user enters
the URL of a home page in the web browsers address line. A URL can
be any file, such as an image file, a program, a javascript document or
style sheet document.
URL is composed of two forms absolute URL and relative URL. The
absolute URL is one that contains the name of the protocol and the
hostname. It is the one that points to a resource outside of your own
sites domain. The relative URL is one that contains only the name of
METRO BUSINESS
COLLEGE
200 Dolores St. Arnaiz Ave. Pasay City
the path of a file. It is the one that points to a resources within the
same site.
http://www.mypage.com/index.html
index.html
../global.css
OPENING TAG
ATTIBUTE
CLOSING TAG
What is a Tag?
Tags are the basic units or building blocks of an HTML file (or code as
you may call it now since writing it may be referred to as coding, too).
Web pages are designed and HTML codes are made up of these tags –
they control how the HTML does its structuring laying out and
formatting.
There are so many tags and each has its own use. Some are used to
make your text appear in boldface, Italicized, underlined. Some are
used to make your text bigger, and some are on the contrary, to make
your text smaller. Some can put your text on the center or even on the
far right of the screen. Some can put images and videos to even spice
up your Web page. There are yet so many tags to be discussed so as for
now. let us start discussing on how tags are used.
Structure of a Tag
Tags are enclosed in angle brackets ( ‘<’ & ‘>’) and an example of
its is <!DOCTYPE html>.
Container tags have the start and end tags together with the content
empty tags stand alone and do not require end tags.
<p>This is a paragraph.</p>
<i>This is used to display italics</i>
<u>This is used to display underlined text</u>
<font> face=”Times New Roman” color=”red”>Red-colored
text written in Times New Roman.</font>
<br>
<hr>
<img src=”samplePic.gif”>
now that you know what tags are, you should know that the whole
HTML file is enclosed in <html></html>.
METRO BUSINESS
COLLEGE
200 Dolores St. Arnaiz Ave. Pasay City
Here is an example of an HTML file, notice how the start and end of the
file has the appropriate HTML start and end tags.
<html>
<head>
<title>Jemma Inc</title>
<head>
<body>
This text is in <b>boldface</b>.
<br><br>
This text is <i>italicized</i>.
<br><br>
This text is <u>undelined</u>
</body>
</html>
HTML COMMENTS
METRO BUSINESS
COLLEGE
200 Dolores St. Arnaiz Ave. Pasay City
(<head>)
<body>
<h1>
Document Header Example
</h1>
</body>
</html>
<head>
<body>
METRO BUSINESS
COLLEGE
200 Dolores St. Arnaiz Ave. Pasay City
<h1>
</head>
</body>
</html>
Body Tags
Can you recall that attributes are? Where are they placed?
Attributes provide additional information about the tag and is placed
on the start tag. Since container tags have start tags and the
<body></body> tag is a container tag, it contains attributes. These are
its attributes.
Example Explained
o The <!DOCTYPE html> declaration defines this document to
be HTML5
o The <html> element is the root element of an HTML page
o The <head> element contains meta information about the
document
o The <title> element specifies a title for the document
o The <body> element contains the visible page content
o The <h1> element defines a large heading
o The <p> element defines a paragraph
Attribute
Name definition Values
content on it. In HTML, there are tags for writing paragraphs Yes, it’s a
container tag and it is the <p></p>.
The HTML <p> element defines a paragraph:
Aligning a Paragraph
You can align a paragraph by using the Paragraph Tag Pair <p
align=left>, <p align=right>, <p align=center>.
<html>
<head>
<title>Latest IT Books</title>
<html>
<head>
METRO BUSINESS
COLLEGE
200 Dolores St. Arnaiz Ave. Pasay City
Line Breaks
Have you noticed how your Web browser treats the white spaces
on you HTML file? Your Web browser ignores white spaces and pressing
Enter or the Return key does not actually create a new line on the
chunk of text on your Web page as seen on the code. It will create a
new line for the text that you want to appear on the next line.
METRO BUSINESS
COLLEGE
200 Dolores St. Arnaiz Ave. Pasay City
<html>
<head>
<title> Latest IT Books</title>
</head>
<body>
<font size=”6” face=”arial”>
Text will continue to flow in one line until the text
Reaches the edge of the browser window even if you
Press the Enter key. If you want to beak a line and go
to the next line you have to add the line break tag.
<br />With the line break tag <br /> you can go to the next
Line <br /? Anytime you want.
</font>
</body>
</html>
Quoting Passages
You can place quotes in indented form and shrink it to be set
apart from the main paragraph by using the tag pair <blockquote>
</blockquote>.
<html>
<head>
<title>Poem</title>
</head>
<body>
METRO BUSINESS
COLLEGE
200 Dolores St. Arnaiz Ave. Pasay City
<font size=”5”>
<p>This is an except from the poem Tree.</p>
<blockquote><font face=”Arial” size=”3”>
I think that I shall never see a poem as lovely as a tree
</blockquote>
</font>
</body>
</html>
<!DOCTYPE html>
<head>
<title> the CENTER element</title>
</head>
<body>
<h1>
The CENTER element
</h1>
<center>
<p> Standards-Based Approach for Offering a Managed
Security Services in a Multivendor Network Environment.
<br />
By Kunjal Trivedi, Cisco System and Damien Holloway.
Juniper Networks
METRO BUSINESS
COLLEGE
200 Dolores St. Arnaiz Ave. Pasay City
</p>
<p>
A standard-based approach helps service providers take
best advantage of the managed security service opportunity because it
increases the potential breadth and depth of the service offering.
Multivendor solutions are becoming the norm when deploying services
on an integrated backbone. Therefore, standards simplify deployment
and management, helping control operational costs and accelerating
time to market.
</p>
</center>
</body>
</html>
<!DOCTYPE html>
<head>
<title>the ADDRESS element</title>
</head>
<body>
<h1>
the ADDRESS element
</h1>
<address>
METRO BUSINESS
COLLEGE
200 Dolores St. Arnaiz Ave. Pasay City
<!DOCTYPE html>
<head>
<title> the DIVISION element</title>
</head>
<body>
<h1> the DIVISION element
</h1>
<div align=”left”>
<p>
The content using the LEFT ALIGNMENT attribute of the
division element.
</p>
</div>
<div align=”center”>
<p>
METRO BUSINESS
COLLEGE
200 Dolores St. Arnaiz Ave. Pasay City
<!DOCTYPE html>
<head>
<title> the PREFORMATTED element</title>
</head>
<body>
<h1>
The PREFORMATTED element
</h1>
<pre>
GOD’S BOUQUET
by Jerry Johnson
METRO BUSINESS
COLLEGE
200 Dolores St. Arnaiz Ave. Pasay City
<html>
<head>
<title> the CITATION element<title>
</head>
<body>
<h1>
The CITATION element
</h1>
METRO BUSINESS
COLLEGE
200 Dolores St. Arnaiz Ave. Pasay City
<html>
<head>
<title> the SUPERSCRIPT element</title>
</head>
<body>
<h1> the SUPERSCRIPT element </h1>
<p>
` MATH EQUATIONS
<br /><br />
METRO BUSINESS
COLLEGE
200 Dolores St. Arnaiz Ave. Pasay City
(5x<sup>2</sup>y<sup>5</sup>)
(-4x<sup>4</sup>y<sup>3</sup>)
<br />
25r<sup>2</sup> - 60rs + 36s<sup>2</sup>
</p>
</body>
</html>
<html>
<head>
<title> the SUBSCRIPT element</title>
</html>
<p>
CHEMICAL BONDING
<br /><br />
Water: H<sub>2</sub>0
<br />
METRO BUSINESS
COLLEGE
200 Dolores St. Arnaiz Ave. Pasay City
Using Lists
List are often easier to read than paragraphs. They are also a
great way to provide information in a structured, easy-to read format.
Furthermore, they help our visitor to easily spot information, and they
draw attention to important information. Lists come in two varieties:
numbered (ordered) and bulleted(unordered).
<html>
<head>
<title> the UNORDERED LIST element</title>
</head>
<body>
<h1>
Top new features of Adobe Dreamweaver CS3
<br />
<ul>
<li>Spry framework for Ajax</li>
<li>Spry widgets</li>
<li>Spry effects</li>
<li>Advanced Photoshop CS3 integration</li>
<li>Browser Compatibility Check</li>
</ul>
</body>
</html>
METRO BUSINESS
COLLEGE
200 Dolores St. Arnaiz Ave. Pasay City
<html>
<head>
<title> the ORDERED LIST element</title>
</head>
<body>
<h1>
The ORDERED LIST element
</h1>
<ol>
<li> In a large bowl, with a mixer on medium speed,
beat 1 ½ cups butter, sugar, orange peel and vanilla until smooth. Beat
in egg until well blended.</li>
<li> In a medium bowl,, mix flour, baking powder and
salt. Add to butter mixture, stir to mix, then beat on low speed until
dough comes together, <br />about 5 minutes (see note preceding).
Mix in cranberries and coconut</li>
<li>Shape dough into 1-inch balls and place about 2
inches apart on buttered 12 by 15-inch baking sheets</li>
<li>Bake in 350<sup>o</sup> regular or convection
oven until cookie edges just begin to brown, 11 to 15 minutes</li>
</ol>
METRO BUSINESS
COLLEGE
200 Dolores St. Arnaiz Ave. Pasay City
</body>
</html>
Invisible Comments
Aside from white spaces, there are other things your Web browser
ignores, these are comments. Since they will not be displayed by the
browser, comments can be used to put significant statements and/or
remarks that you do not want to be displayed. The comment tag is a
container tag that uses<!—as a starting tag and – - as and end tag.
<html>
<head>
<title>Latest IT Books</title>
</head>
<body bgcolor=”#000000” text=”#ffffff”>
<!- -
This is my comment which will not be displayed on the page
-->
This is a page with black background and test changed to
white.
</body>
<html>
You can change the background color of the page by using the
bgcolor attribute <body bgcolor=value”>_<</body>
<html>
<head>
<title> Latest IT Books</title>
</head>
<body bgcolor=”#ff0000”>
This is the first line of the text. Even if you press the
Enter key now no new line will be created.
</body>
<html>