背景をベースラインに揃えたい場合は、疑似要素を使用してそれを行うことができます。
h2::before, h1::before{
content: "";
display: inline-block;
height: 2em;
background: gray;
width: 100%;
margin-right: -100%;
}
h2{
color: white;
}
<h1>A title with some CAPS and some gg's</h1>
<h2>LOREM IPSUM</h2>
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加