gpt4 book ai didi

html - 动态对齐 :after according to parent length

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

http://jsfiddle.net/VpW5x/1141/

.one-line {
position: relative;
}

.one-line:after {
content: '';
position: absolute;
top: 0;
bottom: 0;
width: 25px;
background: red;
clip-path: polygon(100% 50%, 0 0, 0 100%);
left: 100%;
}

如何使右箭头出现在文本之后,即使文本真的像示例中那样长?

最佳答案

使用这个 css 会帮助你

          .one-line {
position: relative;
display:inline-block;
vertical-align:top;
}

.one-line:after {
content: '';
position: absolute;
top: 0;
bottom: 0;
width: 25px;
background: red;
clip-path: polygon(100% 50%, 0 0, 0 100%);
left: 100%;
}

关于html - 动态对齐 :after according to parent length,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53266912/

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