ベースラインごとにヘッダーをテキストの本文に揃えようとしていますが、これは驚くほど難しいようです。私はさまざまな方法を試してきましたが、完璧な解決策を見つけることができないようです。これが私が求めているものの例です:
<h2>XxMmxX</h2>
<p class="right">
I saw for the first time the earth's shape. I could easily see the shores of continents, islands, great rivers, folds of the terrain, large bodies of water. The horizon is dark blue, smoothly turning to black. . . the feelings which filled me I can express with one word—joy.
</p>
スタイル:
h2 {
position: relative;
font-size: 24px;
line-height: 40px;
text-align: right;
width: 190px;
top: 30px;
}
.right {
margin-left: 200px;
font-size: 14px;
line-height: 20px;
}
'XxMmxX'のベースラインをテキストのベースラインに合わせたいのですが。
いくつかのメモ:
- ヘッダーは右揃えで、幅は固定されています
- ヘッダーは本文よりも大きいフォントサイズを使用します
- 完全に整列させたいのですが、これは、ピクセルの上部を設定してほぼ整列させるだけではないことを意味します。(このページは印刷され、これは間違いなく目立ちます)