Hide Marker for List Items
To hide marker for the list items in a list using CSS, set list-style-type
property for the list with the none
value as shown in the following.
</>
Copy
ol {
list-style-type: none;
}
/* or */
ul {
list-style-type: none;
}
Examples
1. Hide marker for Ordered List
In the following example, we take an ordered list and specify none
for the list-style-type
property in List CSS.
index.html
</>
Copy
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<style>
ol {
list-style-type: none;
}
</style>
</head>
<body>
<ol>
<li>Apple</li>
<li>Banana</li>
<li>Cherry</li>
<li>Mango</li>
</ol>
</body>
</html>
2. Hide marker for Unordered List
In the following example, we take an unordered list and specify none
for the list-style-type
property in List CSS.
index.html
</>
Copy
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<style>
ul {
list-style-type: none;
}
</style>
</head>
<body>
<ul>
<li>Apple</li>
<li>Banana</li>
<li>Cherry</li>
<li>Mango</li>
</ul>
</body>
</html>
Conclusion
In this CSS Tutorial, we learned how to use CSS list-style-type
property to hide the marker for list items, with examples.