長さ

<length> (CSS)

<length> (CSS)

相対量単位

emM 幅 (全角1文字)[CSS], [4052]
enN 幅 (半角1文字)[4052]
exx 高さ (≒ N幅)[CSS]
px画素単位[CSS], [4052]
漢字1文字幅[4052]
行幅及び行間[4052]
行幅行幅[4052]

絶対量単位

barleycorn(2pi)
in[CSS]
cm[CSS], [4052]
m
mm[CSS], [4052]
pcパイカ[CSS]
pi(1/6吋)
jptポイント (日本)[4052]
ptポイント (DTP)[CSS], [4052]
q[4052]

算出

SVG

length (MathML)

[4054] MathML における length は、サイズ (size) 間隔取り (spacing) 等々に用いる長さ (length) を表すものです >>4053

仕様書

構文

[4055] length は、次の3種類のいずれかです >>4053

[4069] 明記はされていませんが、明記されていないということは大文字・小文字を区別するようです。

number の後に unit

[4059] number の後に unit を指定すると、その単位での長さを表します。 両者の間に間隔 (space) を挟むべきではありません (should not) >>4053

[4060] unit として使用できるものは次の単位です。これらは CSS に由来しています。 >>4053

emem
exex
px現在ディスプレイにおける画素
inインチ (1in = 2.54cm)
cmセンチメートル
mmミリメートル
ptポイント (72pt = 1in)
pcパイカ (1pc = 12pt)
%既定値百分率

[4067] pxcm のような絶対単位よりも emex のような相対単位の方が一般的には好ましい (generally to be preferred) とされています。 >>4053

[4061] 更に、要素によっては擬似単位 (pseudo-unit) が使用できることがあります。

namedspace

[4064] namedspace を使うと間隔の名前によって長さを指定することができます。

[4065] 認められている値と、その表す既定値として推奨 (recommended) されている値は次の通りです。 ただし実際の値は実装規定とされています。 >>4053

veryverythinmathspace1/18em
verythinmathspace2/18em
thinmathspace3/18em
mediummathspace4/18em
thickmathspace5/18em
verythickmathspace6/18em
veryverythickmathspace7/18em
negativeveryverythinmathspace-1/18em
negativeverythinmathspace-2/18em
negativethinmathspace-3/18em
negativemediummathspace-4/18em
negativethickmathspace-5/18em
negativeverythickmathspace-6/18em
negativeveryverythickmathspace-7/18em

number

[4062] 単位なしで number だけを指定すると、既定値に対する倍数を表します。 この形式は後方互換性のためのものであり、避けるべきです (should) >>4053

処理モデル

[4063] 場合によっては属性値の認められる範囲が制限されていることがあり、 実装は最も近い認められる値に切上げ切捨てして構いません (free) >>4053

[4066] 視覚媒体 (visual media) においては、 表示文脈 (display context) が表示上の特性情報を保有しており、 これをレンダリング・エージェントに提供します。 length の解釈はそれによって定まります。 具体的には、

[4068] 非視覚媒体 (non-visual media) 長さレンダリングに反映されるか、 されるとしたらどう反映されるのかは実装規定です。 >>4053

[4070] Basic Data Types and Interfaces – SVG 1.1 (Second Edition) ( ( 版)) http://www.w3.org/TR/2011/REC-SVG11-20110816/types.html#DataTypeLength

[4075] IRC logs: freenode / #whatwg / 20121017 ( ( 版)) http://krijnhoetmer.nl/irc-logs/whatwg/20121017

[4076] Chrome では媒体機能'width' などで <length> が求められているところ、単位なしの数値を指定できるようです。 Firefox では構文エラーになります。

[4077] Fix https://www.w3.org/Bugs/Public/show_bug.cgi?id=27170. Define a "n... · cdfbd7f · heycam/webidl ( ( 版)) https://github.com/heycam/webidl/commit/cdfbd7f915d377f7c818c4f3e3fbb8be0a92ac37

[8] OASIS Open Document Format for Office Applications (OpenDocument) Version 1.2 - Part 1: OpenDocument Schema ( 版) http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#a18_3_18length

[9] OSLC Core Version 3.0. Part 3: Resource Preview () http://docs.oasis-open.org/oslc-core/oslc-core/v3.0/cs01/part3-resource-preview/oslc-core-v3.0-cs01-part3-resource-preview.html

oslc:hintHeight String Zero-or-one Preferred height of the preview. Values are expressed using length units as specified in [CSS21].

oslc:hintWidth String Zero-or-one Preferred width of the preview. Values are expressed using length units as specified in [CSS21].

[10] OSLC Core Version 3.0. Part 3: Resource Preview () http://docs.oasis-open.org/oslc-core/oslc-core/v3.0/cs01/part3-resource-preview/oslc-core-v3.0-cs01-part3-resource-preview.html

5.6.2 Servers must express the oslc:hintWidth and oslc:hintHeight properties of an oslc:Preview in length units as specified in [CSS21].

[11] OSLC Core Version 3.0. Part 4: Delegated Dialogs () http://docs.oasis-open.org/oslc-core/oslc-core/v3.0/cs01/part4-delegated-dialogs/oslc-core-v3.0-cs01-part4-delegated-dialogs.html

4.1.5 Servers must express the oslc:hintWidth and oslc:hintHeight properties of an oslc:Dialog in length units as specified in [CSS21].

[12] OSLC Core Version 3.0. Part 7: Vocabulary () http://docs.oasis-open.org/oslc-core/oslc-core/v3.0/cs01/part7-core-vocabulary/oslc-core-v3.0-cs01-part7-core-vocabulary.html

http://open-services.net/ns/core#initialHeight

initialHeight is an RDF property.

Recommended initial height of the preview. The presence of this property indicates that the preview supports dynamically computing its size. Values must be expressed in relative length units as defined in the W3C Cascading Style Sheets Specification (CSS 2.1). Em and ex units are interpreted relative to the default system font (at 100% size).

[13] Editorial: use JavaScript string length (annevk著, ) https://github.com/whatwg/dom/commit/870ba05ed1199ce440a3f7376a0248569a6f9027

[14] Editorial: use JavaScript string length by annevk · Pull Request #538 · whatwg/dom () https://github.com/whatwg/dom/pull/538

[15] [cssom] Cleanup some serialization bits. (emilio著, ) https://github.com/w3c/csswg-drafts/commit/5cc9ddd332465b7512befe06dd650754c824645a

[16] Editorial: remove redundant requirement for existence of 'length' (Ms2ger著, ) https://github.com/heycam/webidl/commit/13e5ff2479f60328427456745dd721594fd7ee39

[17] Editorial: remove redundant requirement for existence of 'length' by Ms2ger · Pull Request #667 · heycam/webidl () https://github.com/heycam/webidl/pull/667