There is a border that is divided into two parts, the indent between them is about 80px, inside this space is the text – Gold. How do I make this border?
Preferably done in pure CSS and HTML.
Example:
Here I tried to make this frame, as in the example above, but it turned out, to put it mildly, not very good. I can’t make a bordering radius and move the space to the left side.
body {
background: #333;
}
.frame {
border-left: 1px solid #FFF;
border-right: 1px solid #FFF;
border-bottom: 1px solid #FFF;
border-top: 0px solid #FFF;
border-radius: 17px;
padding: 0;
margin-top: 30px;
}
.top-line {
display: flex;
justify-content: space-between;
}
.top-line-left,
.top-line-right {
flex: 1;
height: 1px;
background-color: #FFF;
}
.top-line-left {
margin-right: 80px;
}
.content {
padding: 20px;
}
<div class="frame">
<div class="top-line">
<div class="top-line-left"></div>
<div class="top-line-right"></div>
</div>
<div class="content"></div>
</div>
P.S.
I just started to learn HTML and CSS, don’t judge the code too harshly. I will be glad to any criticism and advice
2
Answers
one easy way to make that effect is to use the HTML tags
fieldset
andlegend
If the outter background color is known, you can do something like this:
Adjust the top, left, padding of
.title
class to match your layout