属性名 | dominant-baseline |
---|---|
値 | auto | text-top | text-bottom | alphabetic | ideographic | middle | central | mathematical | hanging |
初期値 | auto |
適用可能要素 | ブロックコンテナ、インラインボックス、テーブル行、グリッドコンテナ、フレックスコンテナ、SVGテキスト |
継承 | 継承する |
サポート | https://caniuse.com/mdn-css_properties_dominant-baselinea |
テキストの主要ベースラインを指定します。現時点では SVG の <text>
、<textPath>
、<tref>
、<tspan>
のみで使用できます。
<svg viewBox="0 0 560 150" width="560" height="150" style="border:1px solid #ccc; font-size:120%;"> <path d="M10,30 L550,30" stroke="gray" /> <path d="M10,70 L550,70" stroke="gray" /> <path d="M10,110 L550,110" stroke="gray" /> <text x="20" y="30" style="dominant-baseline:auto;">auto</text> <text x="110" y="30" style="dominant-baseline:alphabetic;">alphabetic</text> <text x="260" y="30" style="dominant-baseline:central;">central</text> <text x="390" y="30" style="dominant-baseline:middle;">middle</text> <text x="110" y="70" style="dominant-baseline:text-top;">text-top</text> <text x="260" y="70" style="dominant-baseline:text-bottom;">text-bottom</text> <text x="110" y="110" style="dominant-baseline:ideographic;">ideographic</text> <text x="260" y="110" style="dominant-baseline:hanging;">hanging</text> <text x="390" y="110" style="dominant-baseline:mathematical;">mathematical</text> </svg>