In CSS, there are several properties specifically designed for styling lists. These properties allow you to control the appearance, positioning, and marker styles of ordered and unordered lists. Here are some commonly used list properties:
Specifies the type of marker used for list items.
ul { list-style-type: circle; }
Sets an image as the marker for list items.
ul { list-style-image: url("logo.png"); }
Determines the position of the list marker relative to the text.
ul { list-style-position: outside; }
A shorthand property that combines list-style-type, list-style-image, and list-style-position
ul { list-style: circle outside url("logo.png"); }
Specifies the color of the list marker.
ul { list-style-color: red; }
The list-style-type property specifies the type of list item marker.
By applying different list-style-type values to unordered and ordered lists with specific classes, you can control the appearance and style of the list markers. The code you provided demonstrates how to set various list styles using CSS.
ul.a { list-style-type: circle; } ul.b { list-style-type: square; } ol.c { list-style-type: disk; } ol.d { list-style-type: lower-alpha; } ol.e { list-style-type: upper-alpha; }
<!DOCTYPE html> <html lang="en"> <head> <title>Tutor Joes</title> <style> ul li{ list-style-type: square; list-style-image: url(button.png); } </style> </head> <body> <h1>List Properties In HTML</h1> <ul> <li>Home</li> <li>Product</li> <li>blog</li> <li>Download</li> <li>Contact</li> </ul> </body> </html>
These properties can be applied to both ordered (<ol>) and unordered (<ul>) lists, allowing you to customize the appearance and style of the list markers. By using these properties, you can create visually appealing and well-structured lists that align with your design requirements.
To download raw file Click HereLearn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions