我有一个固定高度和 100% 宽度的容器。它是display:block。
里面有两个包含 text 的相似元素。它们有不同font-size的 s 并且是浮动的——一个在左边,另一个在右边。

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,因为我只用em和不px和font-sizes的文本元素不同。
如何垂直居中文本元素?