HTML Reference HTML by Alphabet HTML by Category HTML Attributes HTML Global Attributes HTML Events HTML Colors HTML Canvas HTML Audio/Video HTML Character Sets HTML Doctypes HTML URL Encode HTML Language Codes HTML Country Codes HTTP Messages HTTP Methods PX to EM Converter Keyboard Shortcuts.

A lot more can be done with lists, CSS, and JavaScript to create interactive drop-down menus, and our menu tutorial will teach you how to create beautiful, modern, interactive, and well-organized menus. The exact presentation of the three list types depends on the user agent. The list-style-position property specifies the position of the list-item markers bullet points. Screen readers and other assistive technologies rely on the nested structure of complex lists to make sense of the hierarchy and logic of data within the list. User agents may present those numbers in a variety of ways.

Save Your Code. If you click the save button, your code will be saved, and you get an URL you can share with others.
Typically, ordered-list items are displayed with a preceding numbering, which can be of any form, like numerals, letters or Romans numerals or even simple bullets. This numbered style is not defined in the HTML description of the page, but in its associated CSS, using the list-style-type property.
HTML Lists - Learn HTML to develop your website in simple and easy steps starting from basic to advanced concepts with examples including overview, basic tags, meta.
HTML Reference HTML by Alphabet HTML by Category HTML Attributes HTML Global Attributes HTML Events HTML Colors HTML Canvas HTML Audio/Video HTML Character Sets HTML Doctypes HTML URL Encode HTML Language Codes HTML Country Codes HTTP Messages HTTP Methods PX to EM Converter Keyboard Shortcuts.
Unordered Lists. An unordered list is a list in which the order of the list items does not matter. Unordered lists should be used when rearranging the order of the list items would not create confusion or change the meaning of the information on the list.
Your Suggestion:

Definition and Usage

This page lists all the HTML elements, which are created using tags. They are grouped by function to help you find what you have in mind easily. An alphabetical list of all elements is provided in the sidebar on every element's page as well as this one.

There are times when you want to control the numbering of ordered lists. For example, your list may be broken up by a paragraph that appears mid-list to expand on a certain concept, or you may create a countdown list that begins at a high number and counts down. Lastly, maybe you'd rather use roman numerals. To reverse the number of a list, simply add the reversed attributed to the opening ol tag.

It should be noted that Microsoft browsers do not support the reversed attribute. If you use this attribute, bear in mind that visitors using Internet Explorer or Edge will see standard numbering. The start attribute is used to to specify the number on which an ordered list starts. For example, imagine you have a list of 5 items, and after the second and fourth items you want to add a sentence or two with additional details. You could use the following HTML to do this without restarting the list numbering after each paragraph.

A few short sentences about Item 2 that we don't want to appear appended to the list item. A second sentence of additional details. We'll use the same technique to properly number Step 5 below.

You can use CSS to change they marker style of an ordered list. In addition to standard numbering referred to as decimal in CSS , you can also use:. We cover the list-style-type CSS property used to implement these numbering styles below.

Description lists are created with the dl tag. Used far less frequently than their ordered and unordered peers, description lists are used to contain name-value groups. Each name-value group consists of one name, or term, placed between dt tags, followed by one or more values with each value, or description, placed between dd tags. For example, if we wanted to use a description list to explain the relationship between members of a family, we might use the following code:.

When that list is rendered, it will be displayed in such a way that the relationships between the terms dt and values dd are clear. A nested list is a list within a list. If you've ever created a bulleted outline in a word processing document you probably used a variety of indentations and bullet point types to denote items that were subpoints of another item in the outline.

This is the effect we're going for when we create nested lists. When that list is loaded in the browser, the nested list will be indented further than the parent list, and a different type of item marker will be displayed. Nested lists aren't just used to organize the visual representation of information. Screen readers and other assistive technologies rely on the nested structure of complex lists to make sense of the hierarchy and logic of data within the list.

You could use assign classes to list items and use CSS to create the same visual effect as a nested list. However, if you did that, the hierarchical and logical structure of the list would be lost to website visitors using assistive technologies. One of the most common uses of lists is to create website navigation menus. The list-style-position property specifies the position of the list-item markers bullet points.

The start of each line of a list item will be aligned vertically. As it is part of the list item, it will be part of the text and push the text at the start:. Note that the list also has default margin and padding. To remove this, add margin: The list-style property is a shorthand property. It is used to set all the list properties in one declaration:. If one of the property values above are missing, the default value for the missing property will be inserted, if any.

Customized list with a red left border This example demonstrates how to create a list with a red left border. Full-width bordered list This example demonstrates how to create a bordered list without bullets.

The type Attribute

Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, PHP, and XML. Unordered Lists. An unordered list is a list in which the order of the list items does not matter. Unordered lists should be used when rearranging the order of the list items would not create confusion or change the meaning of the information on the list. HTML Lists - Learn HTML to develop your website in simple and easy steps starting from basic to advanced concepts with examples including overview, basic tags, meta.