作者:机加工N_918 | 来源:互联网 | 2023-05-18 22:16
HereisanimageofthedesignwhichIamtryingtoachievewithonlyCSS.这是我试图用CSS实现的设计图像。How
Here is an image of the design which I am trying to achieve with only CSS.
这是我试图用CSS实现的设计图像。
How do I achieve such border for the container div so that I can place transparent logo and text in between the gaps. This design will go on a video background. The black background is just for illustration purpose.
如何为容器div实现这样的边框,以便我可以在间隙之间放置透明的徽标和文本。此设计将在视频背景上进行。黑色背景仅用于说明目的。
So far I have tried to achieve something like this as a test:
到目前为止,我试图通过测试来实现这样的目标:
body {
background: black;
}
p {
color: #ffffff;
font-size: 16px;
text-align: center;
padding: 30px;
}
.steps-frame-1 {
margin-top: 60px;
width: 50%;
height: 200px;
margin-left: auto;
margin-right: auto;
}
.steps-frame-1 {
border: 0;
position: relative;
}
.steps-frame-1::after,
.steps-frame-1::before {
content: '';
position: absolute;
width: 100%;
height: 45%;
border: 2px solid #fff;
}
.steps-frame-1::before {
bottom: 0;
border-top: 0;
}
.steps-frame-1::after {
border-bottom: 0;
top: 0;
}
content Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy.
jsFiddle
的jsfiddle
The problem is to get the gap on top border as well for the logo. Also this whole container must be responsive.
问题是在顶部边界以及徽标上留下间隙。整个容器也必须有响应。
Any help will be appreciated.
任何帮助将不胜感激。
4 个解决方案