当前位置:Gxlcms > JavaScript > cssbottom属性怎么用

cssbottom属性怎么用

时间:2021-07-01 10:21:17 帮助过:49人阅读

css bottom属性用于规定元素的底部边缘,该属性定义了定位元素下外边距边界与其包含块下边界之间的偏移。如果 "position" 属性的值为 "static",那么设置 "bottom" 属性不会产生任何效果。

css bottom属性怎么用?

作用:bottom 属性规定元素的底部边缘。

说明:该属性定义了定位元素下外边距边界与其包含块下边界之间的偏移。如果 "position" 属性的值为 "static",那么设置 "bottom" 属性不会产生任何效果。

注释:所有主流浏览器都支持 bottom 属性。任何的版本的 Internet Explorer (包括 IE8)都不支持属性值 "inherit"。

css bottom属性使用示例

  1. <html>
  2. <head>
  3. <style type="text/css">
  4. img.ex1
  5. {
  6. position:absolute;
  7. bottom:0px;
  8. }
  9. img.ex2
  10. {
  11. position:relative;
  12. bottom:-100px;
  13. }
  14. </style>
  15. </head>
  16. <body>
  17. <img class="ex1" src="https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg" />
  18. <h1>This is a heading</h1>
  19. <img class="ex2" src="https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg" />
  20. </body>
  21. </html>

效果输出:

f12bb102d89b75fa5b6426269f69a5c.png

以上就是css bottom属性怎么用的详细内容,更多请关注Gxl网其它相关文章!

人气教程排行