Sunday, January 9, 2011

Add Definition Lists To Your Web Pages Using HTML & XHTML

How To Add Definition Lists To Your Web Pages Using HTML & XHTML

Posted By CodeNique @ 10:15:56 PM
Print This Page Share & Bookmark This Page
A definition list is the best way to present a glossary, a list of terms, descriptions or anything else you see fit.
In order to create the definition list you will need three tags to accomplish this, all three tags require an end tag. You will first need to type in the <dl> tag, which stands for definition list. The <dl> tag will be the container tag for the <dt> and <dd> tags. Then you will need to type in the <dt> tag for each term. The <dt> tag stands for definition term. The last tag is the <dd> tag, which stands for definition data; this tag must follow the <dt> tag in a definition list to provide the definition for the term. I will show you what I mean in the upcoming example below.
A little fact that you should know is that browsers will typically indent definitions on a new line below the definition term.
Here is how to code a definition list.
<html>
<head>
<title>Welcome To HTML & XHTML</title>
</head>
<body>
<dl>
<dt>HTML</dt>
<dd>

Hypertext Markup Language, or HTML, is a simple language used to create the web pages that appear on the World Wide Web
</dd>
<dt>JavaScript</dt>
<dd>
JavaScript is a scripting language designed to add interactivity to web pages by embedding script code directly in HTML code.
</dd>
</dl>
</body>
</html>


Here is how the above code should look like.
HTML
Hypertext Markup Language, or HTML, is a simple language used to create the web pages that appear on the World Wide Web
JavaScript
JavaScript is a scripting language designed to add interactivity to web pages by embedding script code directly in HTML code.

No comments: