HTML (Cont.)
There are hundreds of other tags used to format and layout the data in a web page.
Tags are also used to specify hypertext links, for example,
<a href="http://www.nfl.com/news/">NFL News</a>
where ‘a
’ and ‘/a
’ delimit an anchor, and “href
” introduces a hypertext reference, which in this case is a URL.
The text “NFL News” will be the label appearing on the link in the browser.
On the other hand, the last tag </html>
means the end of the HTML document.
An example of the correct structure for an HTML document is on the right, where the directory public_html is usually used to store web pages.
|
|
~/public_html/Demo.html
|
<html>
<head>
<title>Title of page</title>
</head>
<body>
This is my first homepage.
<b>This text is bold.</b>
</body>
</html>
|
|
Assuming the file is saved as ~/public_html/Demo.html
, the browser will then display the file at http://undcemcs01.und.edu/~userid/Demo.html
.
- The first tag in the HTML document is
<html>
, which tells the browser that this is the start of an HTML document.
On the other hand, the last tag </html>
means the end of the HTML document.
- The text between the
<head>
tag and the </head>
tag is header information, which is not displayed in the browser window.
- The text between the
<title>
tags is the title of your document, which is displayed in the browser’s caption.
- The text between the
<body>
tags is the text that will be displayed in the browser.
- The text between the
<b>
tags will be displayed in a bold font.
Demonstration
The following demonstration shows how the HTML script is displayed on the Web.