首頁  >  文章  >  web前端  >  css bottom屬性怎麼用

css bottom屬性怎麼用

藏色散人
藏色散人原創
2019-05-29 13:55:523074瀏覽

css bottom屬性用於規定元素的底部邊緣,該屬性定義了定位元素下外邊距邊界與其包含區塊下邊界之間的偏移。如果 "position" 屬性的值為 "static",則設定 "bottom" 屬性不會產生任何效果。 

css bottom屬性怎麼用

css bottom屬性怎麼用?

作用:bottom 屬性規定元素的底部邊緣。

說明:此屬性定義了定位元素下外邊距邊界與其包含區塊下邊界之間的偏移。如果 "position" 屬性的值為 "static",則設定 "bottom" 屬性不會產生任何效果。 

註解:所有主流瀏覽器都支援 bottom 屬性。任何的版本的 Internet Explorer (包括 IE8)都不支援屬性值 "inherit"。

css bottom屬性使用範例

<html>
<head>
<style type="text/css">
img.ex1
{
position:absolute;
bottom:0px;
}
img.ex2
{
position:relative;
bottom:-100px;
}
</style>
</head>
<body>
<img  class="ex1" src="https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg" / alt="css bottom屬性怎麼用" >
<h1>This is a heading</h1>
<img  class="ex2" src="https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg" / alt="css bottom屬性怎麼用" >
</body>
</html>

效果輸出:

css bottom屬性怎麼用

以上是css bottom屬性怎麼用的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn