【发布时间】:2017-05-29 20:27:15
【问题描述】:
【问题讨论】:
-
你尝试过什么?向我们展示你的努力。
-
已经提出了想法并且它的工作正常:)
标签: html css css-shapes
【问题讨论】:
标签: html css css-shapes
可以使用转换后的伪元素来创建:
body { text-align: center; }
.text {
display: inline-block;
vertical-align: top;
padding-bottom: 10px;
position: relative;
text-align: center;
padding: 20px 10px;
line-height: 24px;
min-width: 100px;
background: #333;
font-size: 20px;
color: #fff;
}
.text::before {
transform: translateX(-50%);
border-radius: 100%;
position: absolute;
background: blue;
bottom: 10px;
height: 8px;
content: '';
width: 8px;
left: 50%;
}
<div class="text">about</div>
【讨论】:
.char {
display: inline-block;
position: relative;
}
.char::before {
content: '.';
display: inline-block;
position: absolute;
bottom: -0.5em;
left: 0;
text-align: center;
width: 100%;
}
在堆栈上写完这个问题后,我想出了一个主意:) 它的工作方式非常像我想要的 :)
【讨论】: