top

top

仕様書

実装

[1] display: none のときの top の値は? https://suika.suikawiki.org/gate/2007/cssom/viewer?c=p%20%7B%0D%0A%20%20display%3A%20none%3B%0D%0A%20%20position%3A%20absolute%3B%0D%0A%20%20top%3A%2010em%3B%0D%0A%7D;h=%3Cinput%20type%3Dbutton%20onclick%3D%22%0D%0A%20%20var%20el%20%3D%20document.getElementsByTagName%20('p')%5B0%5D%3B%0D%0A%20%20var%20sd%20%3D%20getComputedStyle%20(el%2C%20null)%3B%0D%0A%20%20w%20('getComputedStyle%3A%3A%20display%3A%20'%2Bsd.display%2B'%2C%20position%3A%20'%2Bsd.position%2B'%2C%20top%3A%20'%2Bsd.top)%0D%0A%22%20value%3DgetComputedStyle%3E%0D%0A%3Cinput%20type%3Dbutton%20onclick%3D%22%0D%0A%20%20var%20el%20%3D%20document.getElementsByTagName%20('p')%5B0%5D%3B%0D%0A%20%20var%20sd%20%3D%20el.currentStyle%3B%0D%0A%20%20w%20('currentStyle%3A%3A%20display%3A%20'%2Bsd.display%2B'%2C%20position%3A%20'%2Bsd.position%2B'%2C%20top%3A%20'%2Bsd.top)%0D%0A%22%20value%3DcurrentStyle%3E%0D%0A%3Cp%3E;p=n;x=style-element (名無しさん)

[2] >>1 の結果

Opera 9

WinIE 6

Firefox 2

(名無しさん)

[3] >>1 を少し変えてみた position: relative https://suika.suikawiki.org/gate/2007/cssom/viewer?c=p%20%7B%0D%0A%20%20display%3A%20none%3B%0D%0A%20%20position%3A%20relative%3B%0D%0A%20%20bottom%3A%20-10em%3B%0D%0A%7D;h=%3Cinput%20type%3Dbutton%20onclick%3D%22%0D%0A%20%20var%20el%20%3D%20document.getElementsByTagName%20('p')%5B0%5D%3B%0D%0A%20%20var%20sd%20%3D%20getComputedStyle%20(el%2C%20null)%3B%0D%0A%20%20w%20('getComputedStyle%3A%3A%20display%3A%20'%2Bsd.display%2B'%2C%20position%3A%20'%2Bsd.position%2B'%2C%20top%3A%20'%2Bsd.top)%0D%0A%22%20value%3DgetComputedStyle%3E%0D%0A%3Cinput%20type%3Dbutton%20onclick%3D%22%0D%0A%20%20var%20el%20%3D%20document.getElementsByTagName%20('p')%5B0%5D%3B%0D%0A%20%20var%20sd%20%3D%20el.currentStyle%3B%0D%0A%20%20w%20('currentStyle%3A%3A%20display%3A%20'%2Bsd.display%2B'%2C%20position%3A%20'%2Bsd.position%2B'%2C%20top%3A%20'%2Bsd.top)%0D%0A%22%20value%3DcurrentStyle%3E%0D%0A%3Cp%3E;p=n;x=style-element

(名無しさん)

[4] >>1 を少し変えてみた position: relative https://suika.suikawiki.org/gate/2007/cssom/viewer?c=p%20%7B%0D%0A%20%20display%3A%20none%3B%0D%0A%20%20position%3A%20relative%3B%0D%0A%20%20bottom%3A%20-10em%3B%0D%0A%7D;h=%3Cinput%20type%3Dbutton%20onclick%3D%22%0D%0A%20%20var%20el%20%3D%20document.getElementsByTagName%20('p')%5B0%5D%3B%0D%0A%20%20var%20sd%20%3D%20getComputedStyle%20(el%2C%20null)%3B%0D%0A%20%20w%20('getComputedStyle%3A%3A%20display%3A%20'%2Bsd.display%2B'%2C%20position%3A%20'%2Bsd.position%2B'%2C%20top%3A%20'%2Bsd.top)%0D%0A%22%20value%3DgetComputedStyle%3E%0D%0A%3Cinput%20type%3Dbutton%20onclick%3D%22%0D%0A%20%20var%20el%20%3D%20document.getElementsByTagName%20('p')%5B0%5D%3B%0D%0A%20%20var%20sd%20%3D%20el.currentStyle%3B%0D%0A%20%20w%20('currentStyle%3A%3A%20display%3A%20'%2Bsd.display%2B'%2C%20position%3A%20'%2Bsd.position%2B'%2C%20top%3A%20'%2Bsd.top)%0D%0A%22%20value%3DcurrentStyle%3E%0D%0A%3Cp%3E;p=n;x=style-element

(名無しさん)

[5] >>4 の結果

Opera 9

top の値が空文字列なのはおかしい。

WinIE 6

Firefox 2

(名無しさん)

[6] >>4 の結果

Opera 9

top の値が空文字列なのはおかしい。

WinIE 6

Firefox 2

(名無しさん)

[8] Window Object 1.0 ( ( 版)) http://www.w3.org/TR/Window/#dfn-top