line-heightの使い方
Web標準HTML/CSS > line-heightの使い方
line-height
プロパティの説明
line-heightは、文字の行間を指定するプロパティです。全ての要素に指定することができます。
指定できる値
- normal
- 標準設定。ブラウザが自動的に判断。
- CSSで使える数値
- 1.5em, 150%などで大きさを変化させる。
サンプル
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"https://www.w3.org/TR/html4/strict.dtd">
<html lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>サンプルページ</title>
<style type="text/css">
<!--
.l1{
line-height:1.5em;
}
-->
</style>
</head>
<body>
<h1>サンプルページ</h1>
<p>通常の行間。</p>
<p class="l1">line-heightで行間を1.5倍に広げた場合の行間。</p>
</body>
</html>