小白教程
所有教程
关于
Search
172.69.59.80
172.69.59.80
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Pr pos bottom”的源代码
本页内容
上一节:
Css3_pr_columns
下一节:
Pr_class_clear
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:bottom}}[[Category:css reference|159]] = CSS bottom 属性 = 设置图像的底部边缘,在元素的底边上面5px: <sample title="" desc="" lang="html" hererun="1"> img { position:absolute; bottom:5px; } </sample> <run name=""> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>小白教程(xiaobai.wang)</title> <style> img.ex1 { position:absolute; bottom:0px; } img.ex2 { position:relative; bottom:-100px; } </style> </head> <body> <img class="ex1" src="logocss.gif" width="95" height="84"> <h1>This is a heading</h1> <img class="ex2" src="logocss.gif" width="95" height="84"> </body> </html> </run> == 属性定义及使用说明 == 对于绝对定位元素,bottom属性设置单位高于/低于包含它的元素的底边。 对于相对定位元素,bottom属性设置单位高于/低于其正常位置的元素的底边。 '''注意:'''如果"position:static",底部的属性没有任何效果。 '''说明:''' 对于 static 元素,为 auto;对于长度值,则为相应的绝对长度;对于百分比数值,为指定值;否则为 auto。 对于相对定义元素,如果 bottom 和 top 都是 auto,其计算值则都是 0;如果其中之一为 auto,则取另一个值的相反数;如果二者都不是 auto,bottom 将取 top 值的相反数。 {| class="table table-striped table-hover" | 默认值: | auto |- | 继承性: | no |- | 版本: | CSS2 |- | JavaScript 语法: | object.style.bottom="50px" |} == 浏览器支持 == 表格中的数字表示支持该属性的第一个浏览器版本号。 {| class="table table-striped table-hover" ! 属性 ! Chrome ! Internet Explorer / Edge ! Firefox ! Safari ! Opera |- | bottom | 1.0 | 5.0 | 1.0 | 1.0 | 6.0 |} == 属性值 == {| class="table table-striped table-hover" ! 值 ! 描述 |- | auto | 默认值。通过浏览器计算底部的位置。 |- | % | 设置以包含元素的百分比计的底边位置。可使用负值。 |- | length | 使用 px、cm 等单位设置元素的底边位置。可使用负值。 |- | inherit | 规定应该从父元素继承 bottom 属性的值。 |} == 相关文章 == CSS 教程: [[css positioning|CSS Positioning]]
返回至“
Pr pos bottom
”。
上一节:
Css3_pr_columns
下一节:
Pr_class_clear