DHTMLET? |
屬性清單?|?相關(guān)內(nèi)容:
|
height版本:CSS1 兼容性:IE4+ NS6+ 繼承性:無
?
語法:
?
height : auto |
length
?
參數(shù):
?
auto : 無特殊定位,根據(jù)HTML定位規(guī)則載文檔流中分配
length : 由浮點數(shù)字和單位標(biāo)識符組成的長度值 | 百分?jǐn)?shù)。百分?jǐn)?shù)是基于父對象的高度。不可為負(fù)數(shù)。請參閱長度單位
?
說明:
?
檢索或設(shè)置對象的高度。
對于img對象來說,僅指定此屬性,其width值將根據(jù)圖片源尺寸等比例縮放。
對應(yīng)的腳本特性為
height。其值為一字符串,所以不可用于腳本(Scripts)中的計算。請使用style對象的
posHeight,
pixelHeight,以及對象的
offsetHeight等特性。請參閱我編寫的其他書目。
按照樣式表的規(guī)則,對象的實際高度為其下列屬性值之和:
margin-top?+?border-top?+?padding-top
?+?height?+?
padding-bottom?+?border-bottom?+?margin-bottom
而在IE6以前的版本,對象的實際高度卻等于:
margin-top?+?height?+?margin-bottom
在IE6中,已經(jīng)提供了針對此問題的解決方案。而上述屬性的相互關(guān)系,請參看圖例。
?
示例:
?
div { height: 1in; }
div { position:absolute; top:-3px; height:6px; }
?
?
?
蘇沈小雨制作·保留所有權(quán)利
©2001 rain1977.comer . All rights reserved . Terms of Use .