Thursday, 5 February 2015

HEADINGS


FIGURE 4.1
a page containing only header elements.

Headings are used to add titles to sections of a page. HTML defines six levels of headings. Heading tags look like the following:
<h1> movies<h1>
<h2>action/adventure</h2>
  <h3>caper</h3>
<h3>thriller</h3>
<h3>war</h3>
<h2>comedy</h2>
  <h3>romantic comedy</h3>
 <h3>slapstick</h3>
<h2>drama</h2>
<h3>buddy movies</h2>
<h3> mystery</h3>
<h3>romance</h3>
<h2>horror</h2>
Notice that I’ve indented the headings in this example to better show the hierarchy. They don’t have to be indented in your page; in fact, the browser ignores the indenting.
<head>
<title> this is the title. It will be explained later on</title>
</head>
<body>
…your page…
</body>
</html>
You might notice here that each HTML tag is nested. That is, both <body> and </body> tags to giside both <html> tags; the same with both <head> tags. All HTML tags work this way, forming individual nested sections of text. You should be careful never to over-lap tags. That is, never do something like the following:
 <html>
<head>
<body>
</html>
</head>
</body>
Whenever you close an                HTML tag, make sure that you’re closing the most recent unclosed tgt. (you’ll learn more about closing tags as you go on.)
NOTE
In HTML 4.0 and earlier, some tags are optionally closed. In other tags, closing tags are forbidden. In the                                        XHTML 1.0 recommendation, all tags must be closed. If you’re just learning HTML, this won’t be a big deal, but if you already have a passing familiarity with the language, this might surprise you. The examples shown in this book display the proper way to close tags so that older browsers will interpret XHTML 1.0 closures correctly.
THE TITLE

Each HTML page needs a title to indicate what the page describes. it appears in the title bar of the browser when people view the web page. The title is stored in your browser’s favorites(or bookmarks), and also in search engines when they index your pages. Use the <title> tag to give a page a title.
The title indicates what your web page is about and is used to the page in the browser’s list of favorites or bookmarks. Titles also appear in the title bar of t\graphical browsers such as Microsoft internet explorer.
<title>tags are placed within the page header and can be used to describe the contents of the page, as follows:

You can have only one title in the pages, and that title can contain only plain text; that is, no other tags should appear inside the title.

Try to choose a title that’s both short and descriptive of the content. Your title should be relevant even out of context. If someone browsing on the web follows a random link and  ends up on this page , or if a person finds your title in a friend’s browser history list, would he have any idea what this page is about? You might not intend the page to be used independently of the pages you specifically linked to it, but because anyone can link to any page at any time, be prepared for that consequence and pick a helpful title. 

No comments:

Post a Comment