見出しを中央に配置し、両側に垂直方向に中央揃えの線を追加するための css クラスがあります。問題は、css3 バックグラウンド プロパティを使用しており、すべてのブラウザーがそれらをサポートしているわけではないことです。そのため、ブラウザー間の互換性のためにこれを単純化したいのですが、その方法がわかりません。
css3の背景なしで(そして余分な要素や静的な高さ/幅を追加せずに)これを達成する簡単な方法はありますか?
.section-heading {
display: table;
white-space: nowrap;
}
.section-heading:before {
background: linear-gradient(to bottom, black, black) no-repeat left center / 95% 1px;
content: "";
display: table-cell;
width: 50%;
}
.section-heading:after {
background: linear-gradient(to bottom, black, black) no-repeat right center / 95% 1px;
content: "";
display: table-cell;
width: 50%;
}