Monday, December 26, 2011

The Hypertext Markup Language

The Hypertext Markup Language, or HTML as it is commonly known, is used to define a web page. When you define a web page as an HTML document, it is stored in a file with the extension .html. An HTML document consists of a number of elements, and each element is identified by tags. The document will begin with < html > and end with < /html >. These delimiters, < html > and < /html >, are tags, and each element in an HTML document will be enclosed between a similar pair of tags between angle brackets. All element tags are case-insensitive, so you can use uppercase or lowercase, or even a mixture of the two, but by convention they are capitalized so they stand out from the text. Here is an example of an HTML document consisting of a title and some other text:

< html >  

< head > 

< title > This is the blog of Java < /title > 

< /head > 

< body > You can put whatever text you like here. The body of a 
document can contain all kinds of other HTML elements, including 
< b > Java applets < /b >. Note how each element always begins 
with a start tag identifying the element, and ends with an end tag 
that is the same as the start tag but with a slash added. The pair 
of tags around ‘Java applets’ in the previous sentence will display 
the text as bold.

< /body >

< /html > 


There are two elements that can appear directly within the < html > element, a < head > element and a < body > element, as in the example above. The < head > element provides information about the document, and is not strictly part of it. The text enclosed by the < title > element tags that appears here within the < head > element will be displayed as the window title when the page is viewed.

Other element tags can appear within the < body > element, and they include tags for headings, lists, tables, links to other pages, and Java applets. There are some elements that do not require an end tag because they are considered to be empty. An example of this kind of element tag is < hr/ >, which specifies a horizontal rule, a line across the full width of the page. You can use the < hr/> tag to divide up a page and separate one type of element from another.

No comments:

Post a Comment

Thanks for Commenting......