Wednesday, April 4, 2012

How to Format a List of Definitions Using HTML Tags

Sometimes when writing an article online, you may need to display a definition list of terms. To show the list clearly, you should format it properly. Here I am going to show you how to format a list of definitions using HTML tags.

The HTML tags that you need are <dl></dl>, <dt></dt> and <dd></dd>.

The <dl></dl> tag is for the definition list containing terms and corresponding definitions.

The <dt></dt> tag is for the term.

The <dd></dd> tag is for the definition.

Let me give you an example.
Here are the original HTML codes:
<dl>
<dt>black</dt>
<dd>It is a color.</dd>
<dt>red</dt>
<dd>It is another color.</dd>
</dl>
Here is the result:

black

It is a color.

red

It is another color.


Now you know what HTML tags to use when building a definition list on your site next time.

For your information, there are 3 types of list that can be shown using HTML tags. The definition list that is used to define terminology is just one of them. The other two are ordered list (using <ol></ol>and <li></li> tags) and unordered list (using<ul></ul>and <li></li> tags). And you should also know that these lists can be included in one another.

No comments:

Post a Comment

Search & Win