There are three types of lists in HTML -
This list has bulleted list items and no bulleted list items. specific order.
This list is used for ordered list items
This list is used to display the definitions of terms.
We can nest these lists and style them as needed. The CSS property list-style helps us style list items.
The syntax of HTML list is as follows-
<type of list> <li></li> </type of list>
The following example illustrates HTML list-
Live demonstration
<!DOCTYPE html> <html> <head> <style> ul { background-color: papayawhip; list-style-type: square; font-style: italic; } ol { background-color: azure; } </style> </head> <body> <ol> <li>demo1</li> <li> demo 2 <ul> <li>demo a</li> <li>demo b</li> </ul> </li> <li>demo 3</li> </ol> </body> </html>
This will give the following output−
Live Demonstration
<!DOCTYPE html> <html> <head> <style> dt { font-weight: bold; font-style: italic; } dd { border: thin dotted; } </style> </head> <body> <h2>Programming Languages and Databases</h2> <dl> <dt>Java</dt> <dd>A programming language developed by James Gosling.</dd> <dt>C++</dt> <dd>A programming language developed by Bjarne Stroustrup.</dd> <dt>MySQL</dt> <dd>MySQL is an open-source relational database management system.</dd> </dl> </body> </html>
This gives the following output-
The above is the detailed content of HTML list type. For more information, please follow other related articles on the PHP Chinese website!