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

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Google Going Native With Chrome
Mozilla Fixes Firefox Flaws as 3.5 Release Nears
Microsoft and Novell Still Bosom Buddies

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, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
XML and PHP Simplified · Creating a ASP.NET Contact Form · Data Filtering with PHP
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Intel to Host Live Nehalem Q&A · 12 Tips to Troubleshoot Network File-Sharing · 10 Tips for Selling on Kijiji