English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The bottom CSS property specifies the offset of the bottom edge of the positioned element relative to the bottom of the reference element's box or the browser window.
对于定位绝对的元素,该bottom属性指定元素框的底部边缘在其包含块的底部边缘上方偏移的距离。
对于定位相对的元素,该bottom属性指定相对于框本身的底边的偏移量(即,方框在正常流中给定一个位置,然后根据这些属性从该位置偏移)。
下表为此属性的用法说明和版本历史记录,以及该属性在javascript脚本中的使用语法。
默认值: | auto |
---|---|
适用于: | 元素定位 |
继承: | 没有 |
可动画制作: | 是。请参考 属性动画。 |
版本: | CSS 2、3 |
语法:JavaScript | object.style.bottom="50px" |
该属性的语法如下:
bottom: length | percentage | auto | initial | inherit
下面的示例演示了如何使用bottom属性。
p { position: absolute; bottom: 150px; }测试看看‹/›
下表描述了此属性的值。
值 | 描述 |
---|---|
length | 将偏移量指定为以px,pt,cm,em等为单位的长度值。允许使用负长度值。 |
percentage | 指定百分比偏移量。相对于元素包含块的高度计算百分比。允许使用负百分比值。 |
auto | 浏览器计算底部边缘位置。这是默认值。 |
initial | 将此属性设置为其默认值。 |
inherit | 如果指定,则关联元素采用其父元素bottom的属性值。 |
bottom属性浏览器的兼容性,下表中的数字表示支持该属性的浏览器最低版本号;所有主流浏览器均支持该属性。
|
请参考以下教程:位置(position)CSS,层 CSS。