How to customize html ordered list

醉折花枝作酒筹
Release: 2023-01-06 11:16:39
Original
4242 people have browsed it

In HTML, you can use the list-style-type attribute to customize the ordered list. You only need to set the "list-style-type: type" style to the ol element. The list-style-type attribute sets the type of list item markup.

How to customize html ordered list

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

list-style-type attribute sets the type of list item tag.

Syntax:

元素{
list-style-type:类型;
}
Copy after login

Attribute value:

How to customize html ordered list

##Example:

<html>
  <head>
    <style type="text/css">
      ul.circle {
        list-style-type: circle;
      }
      ul.square {
        list-style-type: square;
      }
      ol.upper-roman {
        list-style-type: upper-roman;
      }
      ol.lower-alpha {
        list-style-type: lower-alpha;
      }
    </style>
  </head>

  <body>
    <p>Type circle:</p>
    <ul class="circle">
      <li>Coffee</li>
      <li>Tea</li>
      <li>Coca Cola</li>
    </ul>

    <p>Type square:</p>
    <ul class="square">
      <li>Coffee</li>
      <li>Tea</li>
      <li>Coca Cola</li>
    </ul>

    <p>Type upper-roman:</p>
    <ol class="upper-roman">
      <li>Coffee</li>
      <li>Tea</li>
      <li>Coca Cola</li>
    </ol>

    <p>Type lower-alpha:</p>
    <ol class="lower-alpha">
      <li>Coffee</li>
      <li>Tea</li>
      <li>Coca Cola</li>
    </ol>
  </body>
</html>
Copy after login
Effect:

How to customize html ordered list

Recommended learning:

html video tutorial

The above is the detailed content of How to customize html ordered list. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template