In CSS, the list-style property is used to control the appearance of list items in HTML lists, such as ordered lists <ol> and unordered lists <ul>. It allows you to customize the list marker style (for example, bullets or numbers), position, and image.
The list-style property can have several sub-properties, including:
visible (default): This value indicates that the element should be visible and displayed on the web page. It's the default behavior for most HTML elements.
1. list-style-type: Specifies the type of marker used for list items. Common values include:
2. list-style-position: Specifies the position of the list marker with respect to the list item text. Common values include:
3. list-style-image: Allows you to use a custom image as the list marker. You specify the image URL as the value.
Here's an example of how to use the list-style property to customize the appearance of an unordered list:
ul {
list-style-type: square;
list-style-position: outside;
list-style-image: url('custom-marker.png');
}
In this example, the unordered list <ul> will have filled square markers positioned outside the list item, and it will use a custom image as the marker.
You can apply similar styles to ordered lists <ol>. as needed, adjusting the values of the list-style sub-properties to achieve the desired list appearance.
Select Language
Set theme
© 2024 ReadyTools. All rights reserved.