.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>
Kết quả:
Làm thế nào để css dòng của nó theo chiều dài của văn bản ví dụ như sau:
Tôi không thấy kết quả tương tự như ảnh chụp màn hình của bạn. Tôi nhận được https://i.stack.imgur.com/2IcrP.png. – TRiG