<dimension>

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

We’d love to hear your thoughts on the next set of proposals for the JavaScript language. You can find a description of the proposals here.
Please take two minutes to fill out our short survey.

<dimension>CSSデータ型で、 <number> とそれに添付された単位を表します (10px など)。

CSS は <dimension> を使用して、長さ (<length>)、時間 (<time>)、周期 (<frequency>)、解像度 (<resolution>)、その他の量を指定します。

構文

<dimension> の構文は、 <number> とすぐ後に識別子である単位を続けます。単位の識別子は、大文字小文字の区別がありません。

有効な dimension

12px      12 ピクセル
1rem      1rem
1.2pt     1.2 ポイント
2200ms    2200 ミリ秒
5s        5 秒
200hz     200 ヘルツ
200Hz     200 ヘルツ (値は大文字小文字の区別なし)

無効な dimension

12 px       単位は数値の直後に来る必要がある。
12"px"      単位は識別子であり、引用符で囲まない。
3sec        秒の単位は "s" であり "sec" ではない。

仕様書

Specification
CSS Values and Units Module Level 4
# dimensions

ブラウザーの互換性

関連情報