国产gaysexchina男同gay,japanrcep老熟妇乱子伦视频,吃奶呻吟打开双腿做受动态图,成人色网站,国产av一区二区三区最新精品

CSS Margin外邊距

2018-10-27 17:09 更新

Margin外邊距是元素邊界與其周圍之間的距離。這包括其他元素和父元素。

以下列表包含外邊距屬性的說明。

  • margin-top
    設置頂邊的邊距。
    Value: auto length %
  • margin-right
    設置右邊的邊距。
    Value: auto length %
  • margin-bottom
    設置底邊的頁邊距。
    Value: auto length %
  • margin-left
    設置左邊的邊距。
    Value: auto length %
  • margin
    此簡寫屬性在單個聲明中設置所有邊的邊距。
    Value: 1 - 4 auto length %

百分比值始終從包含塊的寬度導出,即使用于填充頂部和底部邊緣。

以下代碼將Margin添加到元素。

<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
img {
  border: 4px solid black;
  background: lightgray;
  padding: 4px;
  margin: 4px 20px;
}
</style>
</head>
<body>
  <img src="https://www.www.yjpub.cn/style/download.png" alt="small  banana">
  <img src="https://www.www.yjpub.cn/style/download.png" alt="small  banana">
</body>
</html>

對于內聯(lián)元素,其邊距不會顯示在頂部和底部邊緣。

Margin 簡寫屬性

margin屬性可以有一到四個值。

margin: 2px 5px 7px 9px;
    top margin is 2px
    right margin is 5px
    bottom margin is 7px
    left margin is 9px

margin: 2px 5px 7px;
    top margin is 2px
    right and left margins are 5px
    bottom margin is 7px

margin: 2px 5px;
    top and bottom margins are 2px
    right and left margins are 5px

margin: 2px;
    all four margins are 2px
屬性 描述 CSS
margin-bottom設置底部的邊距1
margin-left設置左邊距1
margin-right設置右邊距1
margin-top設置頂邊距1
margin設置四個方向的頁邊距1


以上內容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號