gpt4 book ai didi

html - 2个边框,分层和不同的颜色,宽度和高度

转载 作者:太空宇宙 更新时间:2023-11-04 13:26:46 26 4
gpt4 key购买 nike

不知道如何描述,所以这是一张图片:

enter image description here

这是我到目前为止尝试过的方法,但跨度不可见。

.border{
border-bottom: 1px solid #666;
width:400px;
position:relative;
}
.border span{
border-bottom:4px solid red;
display:inline-block;
width:50px;
position:absolute;
left:48%;
bottom:-4px;
}

最佳答案

好的,试试这个:

HTML:

<div class="border"></div>

CSS:

.border{
width:400px;
height: 1px; /* instead of border */
background: #666;
position:relative;
}

/* pseudo-element instead of span for cleaner HTML */
.border:before {
content: '';
border-bottom:4px solid red;
display:inline-block;
width:50px;
position:absolute;
left:48%;
top:-2px; /* instead of bottom, go top by half the height */
}

关于html - 2个边框,分层和不同的颜色,宽度和高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23657321/

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