Home >Web Front-end >CSS Tutorial >How to cancel the serial number of li in css

How to cancel the serial number of li in css

醉折花枝作酒筹
醉折花枝作酒筹Original
2021-06-02 14:42:204564browse

In CSS, you can use the list-style-type attribute to cancel the sequence number of li. You only need to set the "list-style-type:none" style to the li element. The list-style-type attribute is used to set the type of list item tag. When the value is none, it means there is no tag.

How to cancel the serial number of li in css

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

Create a new html file, named test.html, to explain how to remove the li tag serial number in css. In the test.html file, create a list using the li tag. Within the css tag, set the style of the list.

In the css tag, set the list-style-type attribute to none to remove the serial number of the li tag.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    
  </head>
  <body>
    <ol class="mycss">
      <li>标签a</li>
      <li>标签b</li>
      <li>标签c</li>
    </ol>
  </body>
</html>

Before adding the effect code:

How to cancel the serial number of li in css

After adding the effect code:

Code:

<style>
      li {
          list-style-type: none;
      }
    </style>

Effect :

How to cancel the serial number of li in css

Extension:

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

Recommended learning: css video tutorial

The above is the detailed content of How to cancel the serial number of li in css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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