October 22, 2011

Definition List

The third type of list is the definition list. It is useful for information that comes in pairs. A definition list starts with the <dl> tag. Each term in the definition list is listed with the <dt> tag. The description for the term is listed with the <dd> tag.  Launch your text editor now and type the next code.

<html>
<head><title>Definiton List</title></head>
<body>

<dl>
<dt>Resistor</dt>
<dd>It is an electronic component that has the ability to
oppose or limit the flow of current.</dd>
</dl>

<dl>
<dt>Capacitor</dt>
<dd>It is an electronic component that has the ability to
store electrical charge for a short period of time.</dd>

</body>
</html>

The code will be displayed this way by the browser.

About the Code:
  • The <dl> tag is the opening tag of definition list. It tells the browser that a definition list is about to start.
  • The <dt> tag is used in conjunction with <dl> and <dd> tag. It means definition term and it is not indented.
  • The </dt> tag is used to tell the browser that the definition term has ended.
  • The <dd> tag describes the definition term. It means definition description. It instructs the browser to start the definition description. It appears indented.
  • The </dd> tag is used to close the definition description tag.
  • The </dl> tag tells the browser to end the definition list.

0 comments: