Most elements mark blocks of the document for particular purpose or formatting: the above
For example, the heading at the top of this page is an H2 element, (a level 2 heading) which is written as:
<H2> 2.1 Elements in HTML </H2>.
Empty Elements
Some elements are empty -- that is, they do not affect a block of the document in some way. These elements do not require an ending tag. An example is the <HR> element, which draws a horizontal line across the page. This element would simply be entered as
<HR>
Upper and Lower Case
Element names are case insensitive. Thus, the the horizontal rule element can be written as any of <hr>, <Hr> or <HR>.
Elements can have Attributes
Many elements can have arguments that pass parameters to the interpreter handling this element. These arguments are called attributes of the element. For example, consider the element A, which marks a region of text as the beginning (or end) of a hypertext link. This element can have several attributes. One of them, HREF, specifies the hypertext document to which the marked piece of text is linked. To specify this in the tag for A you write:
<A HREF="http://downloadandtutorial.blogspot.com"> marked text </a>.
where the attribute HREF is assigned the indicated value. Note that the A element is not empty, and that it is closed by the tag </a>. Note also that end tags never take attributes -- the attributes to an element are always placed in the start tag.
Friday, February 6, 2009
Elements in HTML Documents
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment