Professional Documents
Culture Documents
Web Engineering: (Lecture 3) by Tufail Khattak
Web Engineering: (Lecture 3) by Tufail Khattak
(Lecture 3)
By
Tufail Khattak
Main Topic
Lists
HTML Lists
There are three different types of HTML lists
• Unordered Lists
• Ordered Lists
• Description Lists
Unordered and Ordered lists are more common, and definition
list is less common.
Each list type utilizes its own unique list tag.
HTML List Tags are
Tag Description
<ul> Defines an unordered list
<ol> Defines an ordered list
<li> Defines a list item
<dl> Defines a description list
<dt> Defines a term/name in a description list
<dd> Defines a description of a term/name in a description list
Unordered Lists
Unordered Lists
• An unordered list starts with the <ul> tag and ends with </ul>.
• Each list item starts with the <li> tag and ends with </li>.
• The list items <li> contained inside the <ul> tag will appears
with a bullet preceding the text.
• The default bullet type for most web browsers is a full disc
(black circle),
• but this can be adjusted using an attribute called type.
Unordered Lists Example
<html>
<body>
• An ordered list starts with the <ol> tag and ends with </ol>.
• Each list item starts with the <li> tag and ends with </li>.
</body>
</html>
Ordered Lists Cont.
Unordered Lists (Type Attribute)
<ol>
<li>Tea
<ul>
<li>Green Tea</li>
<li>Black tea</li>
</ul>
</li>
<li>Coffee</li>
<li>Milk</li>
<li>Cheese</li>
</ol>
</body>
</html>
Ordered Lists Start Attribute:
The start attribute allows you to set a new starting digit for the
ordered list element.
<html> <html>
<body> <body>
<h4>Vegetables</h4> <h4>Vegetables</h4>
<html>
<body>
<dl>
<dt>Coffee</dt>
<dd>Black hot drink</dd>
<dt>Milk</dt>
<dd>White cold drink</dd>
</dl>
</body>
</html>