HTML Lists: Representing List of things. There are 3 types of lists
- Ordered List or Numbered List (ol)
- Unordered List or Bulleted List (ul)
- Description List or Definition List (dl)
Ordered List: Representing the List with numbers.
<!DOCTYPE> <html> <body> <h3>WebTechnologies</h3> <ol> <li>HTML</li> <li>CSS</li> <li>JavaScript</li> </ol> </body> </html> |
Unordered Lists: Representing the List with Bullets or other symbols
<!DOCTYPE> <html> <body> <h3>WebTechnologies</h3> <ul> <li>HTML</li> <li>CSS</li> <li>JavaScript</li> </ul> </body> </html> |
Description List: Representing each item in list with its description
<!DOCTYPE> <html> <body> <h3>WebTechnologies</h3> <dl> <dt>HTML</dt> <dd>is used to created Web pages</dd> <dt>CSS</dt> <dd>is used to apply styles to web pages</dd> <dt>JavaScript</dt> <dd>is used to perform client side validations</dd> </dl> </body> </html> |
Type attribute in Lists: Type attribute is used to specify the type of Number or Symbol to show while printing the list.Type attribute can apply to both ordered lists and unordered lists.
Unordered List types:
<ul type = “square”> <ul type = “disc”> <ul type = “circle”> |
Ordered List types:
<ol type = “1”> – Default-Case Numerals. <ol type = “I”> – Upper-Case Numerals. <ol type = “i”> – Lower-Case Numerals. <ol type = “A”> – Upper-Case Letters. <ol type = “a”> – Lower-Case Letters. |
Start attribute: Start attribute represents the starting number of ordered list
<ol type = “1” start = “4”> – Numerals starts with 4. <ol type = “I” start = “4”> – Numerals starts with IV. <ol type = “i” start = “4”> – Numerals starts with iv. <ol type = “a” start = “4”> – Letters starts with d. <ol type = “A” start = “4”> – Letters starts with D. |