最終更新:2015-07-22 (水) 05:46:57 (3210d)  

vertical-align
Top / vertical-align

行のなかでのテキストや画像などの縦方向の揃え位置を指定

定義

  • Value:  	baseline | sub | super | top | text-top | middle | bottom | text-bottom | <percentage> | <length> | inherit
    Initial:  	baseline
    Applies to:  	inline-level and 'table-cell' elements
    Inherited:  	no
    Percentages:  	refer to the 'line-height' of the element itself
    Media:  	visual
    Computed value:  	for <percentage> and <length> the absolute length, otherwise as specified

  • baseline - 適用した要素のベースラインを親要素のベースラインに揃える(初期値)
  • top - 上端揃え
  • middle - 中央揃え
  • bottom - 下端揃え
  • text-top - テキストの上端揃え(テーブルセルへの指定は無効)
  • text-bottom - テキストの下端揃え(テーブルセルへの指定は無効)
  • super - 上付き文字(テーブルセルへの指定は無効)
  • sub - 下付き文字(テーブルセルへの指定は無効)
  • パーセント(%) - その要素のline-heightプロパティの値に対する割合を%で指定(ベースラインが揃った状態を0として、正の値なら上、負の値なら下へ移動)
  • 数値+単位 - 数値にemやexやpxなどの単位をつけて指定(ベースラインが揃った状態を0として、正の値なら上、負の値なら下へ移動)

対象

関連