Languages
[Edit]
EN

CSS - how to use div element as list?

1 points
Created by:
Lani-Skinner
408

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>

See also

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join