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
<br />Not long ago, due to business needs, I...
Operation effect: html <div class="tic-ta...
1. Confirm whether MySQL has been installed. You ...
Mysql-connector-java driver version problem Since...
A few days ago, I watched a video of a foreign gu...
From: https://blog.csdn.net/qq_44761243/article/d...
This article shares the specific code of JavaScri...
This article uses examples to illustrate the prin...
Insert Baidu Map into the web page If you want to...
Introduction By enabling the slow query log, MySQ...
Table of contents 1. js statement Second, js arra...
1. Introduction to Apache Bench ApacheBench is a ...
In writing styles, we can often see this situatio...
Table of contents 1. State Hook 1. Basic usage 2....
Without further ado, let me show you the code. Th...