在css中,content属性与“:before”以及“:after”伪元素配合使用,用于插入内容,语法为“content: normal|none|counter|attr|string|open-quote|close-quote|no-open-quote|no-close-quote|url|initial|inherit;”。

本教程操作环境:windows10系统、CSS3&&HTML5版本、Dell G3电脑。
css中content属性怎么用
content 属性与 :before 及 :after 伪元素配合使用,来插入内容。
语法为:
content: normal|none|counter|attr|string|open-quote|close-quote|no-open-quote|no-close-quote|url|initial|inherit;
指定属性值如下:
立即学习“前端免费学习笔记(深入)”;
示例如下:
123 PHP中文网 - 程序员梦开始的地方。
哔哩哔哩弹幕网 - 好用的学习网站。
输出结果:

示例如下:
插入当前元素编号(指定种类)

css:
html:
5、插入当前元素编号(指定种类)
- 我是第1个li标签
我是li标签中的第1个div标签
- 我是第2个li标签
- 我是第3个li标签
我是li标签中的第2个div标签
- 我是第4个li标签
- 我是第5个li标签










