集册 HTML 标签教程 Style bottom 属性

Style bottom 属性

Xebcnor     最近更新时间:2019-10-10 09:56:19

79

Style bottom 属性

Style 对象参考手册 Style 对象

定义和用法

bottom 属性设置或返回定位元素的底部位置。

该属性规定了元素的底部位置,包括:内边距、滚动条、边框和外边距。

提示:一个定位元素是元素的 position 属性被设置为:relative(相对)、absolute(绝对)或 fixed(固定)。

语法

设置 bottom 属性:

Object.style.bottom="auto|length|%|inherit"

返回 bottom 属性:

Object.style.bottom

描述
auto 默认。通过浏览器计算底部的位置。
length 使用 px、cm 等单位设置元素的底边到最近一个具有定位设置父元素的底部边缘的位置。可使用负值。
% 设置元素的底边到最近一个具有定位设置父元素的底部边缘的百分比位置。
inherit bottom 属性的值从父元素继承。

浏览器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主要浏览器都支持 bottom 属性。

注意:IE7 及更早的版本不支持 "inherit" 值。IE8 只有规定了 !DOCTYPE 才支持 "inherit"。IE9 支持 "inherit"。

实例

展开阅读全文