[英]html Heading Background color?
这是一个让您入门的示例。
这里的主要技巧是counters
的使用。
section { counter-reset: test; } section h3 { counter-increment: test; position: relative; padding-left: 40px; } section h3::before { content: counter(test) "."; position: absolute; top: -4px; left: 0; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: green; color: white; }
<section> <h3>Section 1 Title 1</h3> <h3>Section 1 Title 2</h3> <h3>Section 1 Title 3</h3> </section> <section> <h3>Section 2 Title 1</h3> </section>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.