This article mainly introduces the What is ::marker <style> li::marker { content: "(" counter(list-item) ")"; } li { display: list-item; } </style> <ul> <li>zhaodao88.com Find business opportunities</li> <li>zhaodao88.com Find connections</li> <li>zhaodao88.com Search for purchases</li> </ul> Effect picture: Here, Use ::marker to fill the marker content It should be noted that if ordinary elements want to use The marker style can be written using Use <style> p { margin-left: 12 em; } p.note { display: list-item; counter-increment: note-counter; } p.note::marker { content: "Note " counter(note-counter) ":"; color: blue; font-weight: bold; } </style> <p>zhaodao88.com Find business opportunities</p> <p class="note">zhaodao88.com Search for purchases</p> <p>zhaodao88.com Find connections</p> The effect is as shown: Of course, you can also set font style, color and other attributes for the marker, similar to the above effect It is worth noting that currently only the following attributes can be used on
There is an issue that suggests that using Use list-style-image to fill the tag content Specify a marker image. When the list item content is normal, the marker of the list item is filled with the specified image. The normal value of The following is an example of usage, which will fill the li { list-style-image: url("http://www.example.com/ellipse.png") } Use list-style-type text type to fill the tag content Specify a marker string. When the list item content is normal, fill the list item marker with the specified string. The normal value of @counter-style thumbs { system: cyclic; symbols: "\1F44D"; suffix: " "; } ul { list-style-type: thumbs; } Specific The following is an example of using ul { list-style-type: "★"; } // Use "★" as a marker p.note { // If the target element is not a list element, the element's display must be set to list-item display: list-item; list-style-type: "Note: "; list-style-position: inside; } ol { list-style-type: upper-roman; } // Defined as uppercase Roman numerals ul { list-style-type: symbols(cyclic '○' '●'); } // The marker switches between '○' and '●' ul { list-style-type: none; } // No marker is displayed Notice Summarize Lists are very common in front-end projects and have a wide range of application scenarios. Personally, I think refer to https://www.w3.org/TR/2020/WD-css-lists-3-20200709 This is the end of this article about the use of marker tags in the CSS list model. For more relevant CSS marker tag content, please search 123WORDPRESS.COM’s previous articles or continue to browse the following related articles. I hope that everyone will support 123WORDPRESS.COM in the future! |
<<: The process of deploying a project to another host using Jenkins
>>: A QQ chat room based on vue.js
Table of contents 1. Insert the queried results 2...
CSS Position The position attribute specifies the...
<br />The header refers to the first row of ...
The "nofollow" tag was proposed by Goog...
1. Dynamically create objects There are two ways ...
Preface MySQL master-slave replication is the bas...
Payment countdown to return to the home page case...
In actual use, it is often necessary to share the...
Table of contents Preface What are constructible ...
This article example shares the specific code of ...
All consecutive spaces or blank lines (newlines) ...
For work needs, I found a lot of information on t...
Table of contents Overview 1. Download via URL 2....
Linux uses iftop to monitor the traffic of the ne...
Everyone may be familiar with the select drop-dow...