高さが小さく、幅が 100%のコンテナーがあります。ですdisplay:block。
内部には、 text を含む 2 つの同様の要素があります。それらは異なる を持ちfont-size、フロートされます - 1 つは左に、もう 1 つは右に。

HTML
<header>
<h1 class="right">Title</h1>
<h2 class="left">Slogan</h2>
</header>
CSS
header{ position:fixed; width:100%; height:5em; }
header h1{ font-size:3em; margin:0; }
header h2{ font-size:2em; margin:0; }
使いたくないdisplay:table-cell。そして、私は使用line-heightしているだけであり、テキスト要素の s が異なるため、使用できませemん。pxfont-size
テキスト要素を垂直方向に中央揃えするにはどうすればよいですか?