cuốn sách gpt4 ai đã làm

html -
    列表项的样式命令

In lại Tác giả: Walker 123 更新时间:2023-11-28 01:52:06 28 4
mua khóa gpt4 Nike

我是使用 CSS 列表的后来者。我使用此代码创建列表,其中第一个缩进为 a-z,第二个缩进为罗马、i、ii、iii、iv 等:

/* SF/2013-10-16; this code will create 1.a.i structure similar perh. to a legal document.. */
ol > li > ol {
list-style-type: lower-alpha;
}

ol > li > ol > li > ol {
list-style-type: lower-roman;
}

但我想知道是否有任何方法可以使列表索引 (1,2,3, a,b,c, i,ii,iii) 的字体与实际列表文本本身的字体不同 - 优雅 -以及更改列表索引的大小或颜色。感谢您的帮助!

câu trả lời hay nhất

Nếu bạn sử dụng :trước 伪选择器插入罗马数字,您可以完全控制样式。我使用 counter-increment 函数作为选择器的内容 - 它工作得很好!

Basic jsFiddle here

nhập mô tả hình ảnh ở đây

CSS

li {
kiểu danh sách: không có;
counter-increment: name;
}
li:before {
content: counter(name, lower-roman);
font-size:26px;
color:red;
margin-right:10px;
}

您甚至可以使用 con thứ ndo stuff like this .

li:first-child:before {
content: counter(name, lower-alpha);
font-size:40px;
color:orange;
độ dày phông chữ: đậm;
margin-right:10px;
}
li:nth-child(2n+2):before {
content: counter(name, decimal-leading-zero);
font-size:26px;
color:green;
margin-right:10px;
}
li:nth-child(2n+3):before {
content: counter(name, lower-roman);
font-size:26px;
color:red;
margin-right:10px;
}

关于html -

    列表项的样式命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19418165/

28 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress