gpt4 book ai didi

html - 带中心箭头的 CSS 工具提示

转载 作者:太空宇宙 更新时间:2023-11-03 23:36:58 24 4
gpt4 key购买 nike

我希望黑色箭头位于 div 行的正中央,同时也像现在一样位于底部。这是 JSFiddle .谢谢。

示例代码:

<div class="row divisor">
Text
<br />
text
</div>


.row {
width: auto; }
.row:before, .row:after {
content: " ";
display: table; }

.row { position: relative; }

.divisor {
border-bottom: 1px solid #D8D8D8; }

.divisor:before {
content: " ";
display: block;
position: absolute;
top: 100%;
left: 5px;
right: 5px;
width: 0;
height: 0;
border-left: 40px solid transparent;
border-right: 40px solid transparent;
border-top: 25px solid #000;
}

最佳答案

更改 left: 50%;margin-left: -40px;

.divisor:before {
content: " ";
display: block;
position: absolute;
top: 100%;
left: 50%;
right: 5px;
width: 0;
height: 0;
border-left: 40px solid transparent;
border-right: 40px solid transparent;
border-top: 25px solid #000;
margin-left: -40px;
}

http://jsfiddle.net/iamrmin/mKLJB/3/

关于html - 带中心箭头的 CSS 工具提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23814723/

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