0% found this document useful (0 votes)
2 views2 pages

Creating Lists in HTML

The document explains how to create lists in HTML, detailing attributes such as 'compact', 'reversed', 'start', and 'type' that can be used with ordered lists (<ol>) and unordered lists (<ul>). It emphasizes the importance of using the correct list type based on whether the order of items is significant. Additionally, it notes that lists can be nested and provides examples of when to use <ol> versus <ul>.

Uploaded by

ahmedrameen694
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Creating Lists in HTML

The document explains how to create lists in HTML, detailing attributes such as 'compact', 'reversed', 'start', and 'type' that can be used with ordered lists (<ol>) and unordered lists (<ul>). It emphasizes the importance of using the correct list type based on whether the order of items is significant. Additionally, it notes that lists can be nested and provides examples of when to use <ol> versus <ul>.

Uploaded by

ahmedrameen694
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

CREATING LISTS IN HTML:

Attributes
This element also accepts the global attributes.

compact Deprecated Non-standard


This Boolean attribute hints that the list should be rendered in a
compact style. The interpretation of this attribute is browser-specific.
Use CSS instead: to give a similar effect as the compact attribute, the
CSS property line-height can be used with a value of 80%.

reversed
This Boolean attribute specifies that the list's items are in reverse
order. Items will be numbered from high to low.

start
An integer to start counting from for the list items. Always an Arabic
numeral (1, 2, 3, etc.), even when the numbering type is letters or
Roman numerals. For example, to start numbering elements from the
letter "d" or the Roman numeral "iv," use start="4".

type
Sets the numbering type:

 a for lowercase letters


 A for uppercase letters
 i for lowercase Roman numerals
 I for uppercase Roman numerals
 1 for numbers (default)

The specified type is used for the entire list unless a


different type attribute is used on an enclosed <li> element.
Note: Unless the type of the list number matters (like legal or
technical documents where items are referenced by their
number/letter), use the CSS list-style-type property instead.

Usage notes
Typically, ordered list items display with a preceding marker, such as a
number or letter.

The <ol> and <ul> (or the synonym <menu>) elements may nest as deeply as
desired, alternating between <ol>, <ul> (or <menu>) as needed.

The <ol> and <ul> elements both represent a list of items. The difference is
with the <ol> element, the order is meaningful. For example:

 Steps in a recipe
 Turn-by-turn directions
 The list of ingredients in decreasing proportion on nutrition information labels

To determine which list to use, try changing the order of the list items; if the
meaning changes, use the <ol> element — otherwise you can
use <ul> otherwise, or <menu> if your list is a menu.

You might also like