To fix this issue Most easiest and neat solution would be to use svg to create the border.
#container {
position: relative;
width: 200px;
height: 30px;
}
#content {
text-transform: uppercase;
position: absolute;
width: 200px;
height: 30px;
top: 0;
text-align: center;
line-height: 30px;
}
<div id="container">
<svg width="200" height="30" viewBox="-1 -2 201 33">
<path d="M0,0 h200 l-15,15 l15,15 h-200 l15,-15z" stroke="black" stroke-width="2" fill="none" />
</svg>
<div id="content">lorem ipsum</div>
</div>
#container {
position: relative;
width: 200px;
height: 30px;
margin-bottom: 30px;
}
#content {
text-transform: uppercase;
position: absolute;
width: 200px;
height: 30px;
top: 0;
text-align: center;
line-height: 30px;
}
<div id="container">
<svg width="200" height="30" viewBox="-1 -1 201 33">
<path d="M0,0 h200 q-20,15 0,30 h-200 q20,-15 0,-30" stroke="black" stroke-linejoin="round" stroke-width="2" fill="none" />
</svg>
<div id="content">lorem ipsum</div>
</div>
<div id="container">
<svg width="200" height="30" viewBox="-1 -1 201 33">
<path d="M0,0 h200 q0,10 -15,15 q10,0 15,15 h-200 q0,-10 15,-15 q-10,0 -15,-15" stroke="black" stroke-linejoin="round" stroke-width="2" fill="none" />
</svg>
<div id="content">lorem ipsum</div>
</div>
<div id="container">
<svg width="200" height="30" viewBox="-1 -1 201 33">
<path d="M0,0 h200 q-10,0 -15,12.5 l15,2.5 l-15,2.5 q0,10 15,13 h-200 q10,0 15,-12.5 l-15,-2.5 l15,-2.5 q0,-10 -15,-12.5" stroke="black" stroke-linejoin="round" stroke-width="2" fill="none" />
</svg>
<div id="content">lorem ipsum</div>
</div>
#container {
position: relative;
width: 200px;
height: 30px;
margin-bottom: 30px;
}
#content {
text-transform: uppercase;
position: absolute;
width: 200px;
height: 30px;
top: 0;
text-align: center;
line-height: 30px;
}
<div id="container">
<svg width="205" height="35" viewBox="-1 -1 205 38">
<filter id="f">
<feGaussianBlur stdDeviation="1.5" />
</filter>
<path filter="url(#f)" d="M0,0 h200 l-15,15 l15,15 h-200 l15,-15z" stroke="black" stroke-linejoin="round" stroke-width="2" transform="translate(0,3)" fill="black" />
<path id="shape" d="M0,0 h200 l-15,15 l15,15 h-200 l15,-15z" stroke="black" stroke-linejoin="round" stroke-width="2" fill="white" />
</svg>
<div id="content">lorem ipsum</div>
</div>
<div id="container">
<svg width="205" height="35" viewBox="-1 -1 205 38">
<path filter="url(#f)" d="M0,0 h200 q0,10 -15,15 q10,0 15,15 h-200 q0,-10 15,-15 q-10,0 -15,-15" stroke="black" stroke-linejoin="round" stroke-width="2" transform="translate(0,3)" fill="black" />
<path d="M0,0 h200 q0,10 -15,15 q10,0 15,15 h-200 q0,-10 15,-15 q-10,0 -15,-15" stroke="black" stroke-linejoin="round" stroke-width="2" fill="white" />
</svg>
<div id="content">lorem ipsum</div>
</div>
<div id="container">
<svg width="205" height="35" viewBox="-1 -1 205 38">
<path filter="url(#f)" d="M0,0 h200 q-10,0 -15,12.5 l15,2.5 l-15,2.5 q0,10 15,13 h-200 q10,0 15,-12.5 l-15,-2.5 l15,-2.5 q0,-10 -15,-12.5" stroke="black" stroke-linejoin="round" stroke-width="2" transform="translate(0,3)" fill="black" />
<path d="M0,0 h200 q-10,0 -15,12.5 l15,2.5 l-15,2.5 q0,10 15,13 h-200 q10,0 15,-12.5 l-15,-2.5 l15,-2.5 q0,-10 -15,-12.5" stroke="black" stroke-linejoin="round" stroke-width="2" fill="white" />
</svg>
<div id="content">lorem ipsum</div>
</div>
div {
position: relative;
text-transform: uppercase;
width: 200px;
height: 30px;
text-align: center;
line-height: 27px;
border-top: 3px solid black;
border-bottom: 3px solid black;
box-sizing: border-box;
}
div:after,
div:before {
position: absolute;
content: '';
width: 21.21px;
height: 21.21px;
border-top: 3px solid black;
border-right: 3px solid black;
transform: rotate(45deg);
box-sizing: border-box;
top: 1px;
left: -9px;
}
div:after {
border-right: 0;
border-left: 3px solid black;
left: 100%;
margin-left: -10px;
transform: rotate(-45deg);
}
<div>lorem ipsum</div>