.banner-bottom h2 {
font-size: 2em;
color: #372568;
position: relative;
padding-bottom: 1em;
text-align: center;
}
.banner-bottom h2:before {
content: '';
position: absolute;
top: 25%;
left: 25%;
background: #372568;
height: 2px;
width: 8%;
}
.banner-bottom h2:after {
content: '';
position: absolute;
top: 25%;
right: 25%;
background: #372568;
height: 2px;
width: 8%;
}
<div class="banner-bottom">
<div class="container">
<h2>Special Promo</h2>
<h2>Promo</h2>
<div>
<div>
結果:
:以下のような例を書くの長さに応じてそのラインをCSSにどのよう
あなたのスクリーンショットと同じ結果が表示されません。私はhttps://i.stack.imgur.com/2IcrP.pngを得る。 – TRiG