gpt4 book ai didi

html - block 元素下方的三个点

转载 作者:技术小花猫 更新时间:2023-10-29 11:46:34 25 4
gpt4 key购买 nike

我想设计如下图的东西,但不知道该怎么做!

三点标题

enter image description here

所以我只想在标题下方的中心显示 3 个点。但是当我尝试使用 dottedborder-bottom它需要整个 <h1>标签。

h1{
text-align: center;
font-size: 50px;
color: red;
border-bottom: 10px dotted red;
}
<h1>My Title</h1>

最佳答案

为此使用了 ::after 伪元素

h1{
text-align: center;
font-size: 50px;
color: red;
line-height: 30px;
}
h1::after{
content:"...";
font-size: 50px;
color: gold;
display: block;
text-align: center;
letter-spacing: 5px;
}
<h1>My Title</h1>

关于html - block 元素下方的三个点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46907903/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com