Information Technology Reference
In-Depth Information
web server can be any sort of computer that makes a list of files available to other
computers on the network over something called HyperText Transport Protocol (HTTP,
as in http:// at the beginning of web addresses, which are also called URL s). Browsers
download these HTML files over HTTP and read them, looking for special features
known as tags . These tags function in the same way as tags in older word processor
programs did—specifying how text and other elements of the page should look when
displayed in the viewer. Consider the web page in Figure 1-1.
Figure 1-1. An example web page named hello.html
Let's look at the HTML code that made up the page shown in Listing 1-1:
Listing 1-1. hello.html
<html>
<head>
<title>This is the text that appears in the browser's Title bar!</title>
</head>
<body>
This is normal text. However let's get fancy and make <strong>this bold</strong> (this
is <em>italicized</em>).
<br /> The tag to the left just made this a new line.
<p> The tag to the left here just made this a new paragraph.</p>
</body>
</html>
The code might look a bit strange, but let's walk through it line by line. The first line,
which simply reads <html>, lets the browser know that it's reading an HTML document.
You'll notice that the last line of the document, </html> , is similar. This line “finishes” the
HTML object—closing the tag and telling the browser that the page is over. By having
sets of tags like this, the browser knows what formatting to apply and where to stop
applying it.
The second through fourth lines of the code are known as the page header. This is
where programmers store important information that the browser needs to know in order
to format the page properly. In this case, the only tag I've placed within the header is a
title tag, which specifies what should be shown in the title bar of the user's web
browser. The header would be the location where one would most commonly finds
certain documents, such as Cascading Style Sheets, JavaScript, and META information
for search engine optimization, special instructions for different browsers, favicons
(those little icons that appear next to a bookmark entry in your browser), and other
important information about the page that is not related to the documents'content,
which brings us to line 5 - the body tag.
The body tag tells the browser that the content to display to the user is about to be given.
From here, we see straight text—the same that's in the rendered page shown in Figure 1-1.
However, you'll notice a few special tags we've added in. The first, <strong> , tells the
browser that the text between it and its end tag </strong> should be in bold to give it a
 
Search WWH ::




Custom Search