EN
CSS - how to use div element as list?
1
points
In this article, we would like to show you how to use div element as a list using CSS.
Quick solution:
div {
display: list-item;
list-style-type: circle;
}
Practical example
In this example, we present how to use div elements as list items with a specified list style type.
// ONLINE-RUNNER:browser;
<!doctype html>
<html>
<head>
<style>
div {
display: list-item;
list-style-type: circle; /* disc/circle/square/decimal... */
margin-left: 1em;
}
</style>
</head>
<body>
<div>div 1</div>
<div>div 2</div>
<div>div 3</div>
</body>
</html>