我想在两对水平线之间放置一个 h3 标题,就像这样:
任何人都可以帮助我在 html、css 中实现它
更新
请问我怎么能做到这一点,但有一个锚标签(实际上是一个按钮)我希望它是这样的:
您可以设置伪元素的样式,如下所示:http: //jsbin.com/epeceb/1/
CSS
h3 {
width: 500px;
font: 30px Arial;
font-weight: normal;
text-align: right;
position: relative;
}
h3 span {
background: #fff;
margin-right: 15%;
padding: 0 20px;
}
h3:before {
content: "";
width: 100%;
left: 0;
top: 50%;
margin-top: -4px;
position: absolute;
z-index: -1;
height: 0;
border-top: 8px double red;
}
截屏
实现这一点的最佳方法是在 css 中制作两行,有一个绝对的 div,它将越过带有白色背景的行。应该可以完美运行。