【发布时间】:2021-03-30 08:26:47
【问题描述】:
我正在尝试使用:after 和:before 在 H 标记中的边框后冲刺,它在桌面和 Android 设备上运行良好,但在 IOS 设备中产生问题
使用 :after 和 :before 制作的边框,但 h 元素的文本不显示
下面是其他设备的演示
下面是IOS设备的demo
h2.service-heading {
font-size: 36px;
color: #762d2f;
text-transform: uppercase;
position: relative;
display: table;
margin-left: auto;
margin-right: auto;
max-width: calc(100% - 36px);
position: relative;
}
h2.service-heading::after {
content: '';
position: absolute;
width: calc(100% - 5px);
display: block;
height: 6px;
border-bottom: 6px solid #762d2f;
z-index: 9999;
clear: both;
left: 0;
bottom: 0px;
}
h2.service-heading::before {
content: '';
position: absolute;
width: 10px;
display: block;
height: 6px;
border-bottom: 6px solid #762d2f;
z-index: 9999;
clear: both;
bottom: 0px;
right: -10px
}
<h2 class="service-heading" align="center"> Our Services</h2>
谁能帮忙 提前致谢
【问题讨论】:
-
您的 sn-p 在我的 iPad (IOS 14.4) 上运行良好,我在给定的代码中看不到任何对 IOS 有问题的内容。您能否检查给定的 sn-p 是否对您不起作用,否则其他代码中可能存在其他具有此效果的内容。另外,你测试的是什么版本的IOS?
标签: html css pseudo-element