In certain scenarios, it may be necessary to eliminate the bullet points from unordered and ordered lists. The process of removing list bullets is straightforward when utilizing CSS. This can be achieved effortlessly by specifying the CSS list-style or list-style-type property as none.
The list-style-type CSS attribute is employed to define the marker (such as a circle, symbol, or a customized counter style) of an item in a list. This particular CSS attribute enables us to craft lists without bullet points. It is exclusively applicable to elements with a display setting of list-item. Moreover, the list-style-type attribute is hereditary, allowing it to be implemented on the ancestor element (such as a div or ul) to have it affect all list items.
By default, ordered list items are labeled with Arabic numerals (1, 2, 3, etc.), while unordered list items are denoted by round bullets (•). The list-style-type CSS property enables us to modify the default marker type to various options like square, circle, roman numerals, Latin letters, and numerous others.
If we specify its value as "none", the markers or bullets will be eliminated. Rather than deleting the bullets within a list, we have the option to substitute them with images, enhancing the visual appeal of the website. This can be achieved by utilizing the list-style-image property.
Let's explore the process of eliminating bullet points in C# tutorials through a practical illustration.
Example
In this instance, we are incorporating both numbered and bulleted lists while utilizing the list-style-type attribute set to none to eliminate the bullets of the list entries.
<!DOCTYPE html>
<html>
<head>
<style>
ol {
list-style-type: none;
font-weight: bold;
font-size: 20px;
}
ul {
list-style-type: none;
font-weight: bold;
font-size: 20px;
}
</style>
</head>
<body>
<h2>Ordered list</h2>
<ol>
<li>List Item 1</li>
<li>List Item 2</li>
<li>List Item 3</li>
</ol>
<h2>Unordered list</h2>
<ul>
<li>List Item 1</li>
<li>List Item 2</li>
<li>List Item 3</li>
</ul>
</body>
</html>
Output