Thursday, 5 February 2015

learning HTML program

< ! DOCTYPE html PUBLIC “-/w3c//DTD XHTML 1.0 transitional//EN”
http://www.W3.org/TRxhtml1/DTD/transitional.dtd>
<html>]
<head>
 <title> this is the title. It will be explained later on</title>
</head>
…your page…
</html>
THE <HTML> TAG
The remainder of you HTML page (represented in the following example as…your page..) is enclosed within a <body> tag. This include all the text and other content (links, pictures, and so on). In combination with the<html>and <head>  tags, your code resembles the following:
<! DOCTYPE html PUBLIC “-/w3C//DTD/XHTML 1.0 transitional//EN”
http://www.W3.org/TR/xhtml1/DTD/transitional. dtd>
<html>
<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:
 <! DOCTYPE html PUBLIC “-//W3C //DTD XHTML 1.0 transitional //EN”
http://www.W3,org/TR.xhtml 1//DTD/transitional.dtd>
<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:
<! DOCTYPE html PUBLIC “-//W3C //DTD XHTML 1.0 transitional //EN”
http://www.W3,org/TR.xhtml 1//DTD/transitional.dtd
<html>
<head>

<title> the lion, the witch, and the wardrobe </title>
</head>
<body>
…your page…
</body>
</html>
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