spacer
Yehuda Shiran June 16, 2000
HTML Tag Types
Tips: June 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

There are different ways to open and close HTML tags. The trivial one calls for just an opening delimiter. The List Item tag (<LI>) is a good example for a tag that does not need a closing delimiter. The more popular type is a pair of delimiters (one for opening and one for closing). The following examples demonstrate this type:

<A ......> ..... </A>
<TABLE .........> ...... </TABLE>
<CENTER ....> ...... </CENTER>
<BODY .....> ..... </BODY>

Notice the HTML code between the opening and closing tags (dots above). This is the body of the page for the <BODY> </BODY> pair, or the table body for the <TABLE> </TABLE> pair above. When you don't need to place any HTML code between the tags, you can omit the closing tag and place a forward slash at the end of the opening tag. For example,

<BODY .....> </BODY>

is equivalent to

<BODY ...../>

Take the following tag:

<BODY BGCOLOR="yellow"/>

and see that you get a yellow-background page. You cannot put anything on this page (empty tag), but you get the idea. In our columns, tips, and tutorials, we avoid using this short notation. We prefer the explicit one:

<BODY BGCOLOR="yellow"></BODY>


People who read this tip also read these tips:

Look for similar tips by subject:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business