gpt4 book ai didi

html - 是否可以使用 CSS(不使用图像)执行此 "half strikethrough"

转载 作者:可可西里 更新时间:2023-11-01 13:13:18 24 4
gpt4 key购买 nike

我正在做一个不使用任何图像的网站,以使其响应迅速且速度更快,仅使用 CSS(3)。我正在尝试使用 CSS 实现以下效果

pseudo strikethrough in Illustrator

我以前用过

<div class="strikethrough">
<span>Ou</span>
</div>

和 CSS(使用图像):

.strikethrough {
background: url('strip.gif') repeat-x 50% 50%;
}

.strikethrough span {
background: #EAEBEC;
padding: 0 5px;
display: inline-block;
margin: 0 auto;
}

是否可以只使用 CSS 来做同样的事情?

最佳答案

<div style="height: 1px; text-align: center; background-color: black;">
<span style="position: relative; top: -0.5em; background-color: white;">
Ou
</span>
</div>

<fieldset style="text-align: center; border: 0; border-top: 1px solid black;">
<legend>
Ou
</legend>
</fieldset>

关于html - 是否可以使用 CSS(不使用图像)执行此 "half strikethrough",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16116701/

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