<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # CSS margin 屬性 ## 實例 設置 p 元素的 4 個外邊距: ``` p { margin:2cm 4cm 3cm 4cm; } ``` ## 瀏覽器支持 | IE | Firefox | Chrome | Safari | Opera | | --- | --- | --- | --- | --- | 所有瀏覽器都支持 margin 屬性。 注釋:任何的版本的 Internet Explorer (包括 IE8)都不支持屬性值 "inherit"。 ## 定義和用法 margin 簡寫屬性在一個聲明中設置所有外邊距屬性。該屬性可以有 1 到 4 個值。 ### 說明 這個簡寫屬性設置一個元素所有外邊距的寬度,或者設置各邊上外邊距的寬度。 塊級元素的垂直相鄰外邊距會合并,而行內元素實際上不占上下外邊距。行內元素的的左右外邊距不會合并。同樣地,浮動元素的外邊距也不會合并。允許指定負的外邊距值,不過使用時要小心。 注釋:允許使用負值。 #### 例子 1 ``` margin:10px 5px 15px 20px; ``` * 上外邊距是 10px * 右外邊距是 5px * 下外邊距是 15px * 左外邊距是 20px #### 例子 2 ``` margin:10px 5px 15px; ``` * 上外邊距是 10px * 右外邊距和左外邊距是 5px * 下外邊距是 15px #### 例子 3 ``` margin:10px 5px; ``` * 上外邊距和下外邊距是 10px * 右外邊距和左外邊距是 5px #### 例子 4 ``` margin:10px; ``` * 所有 4 個外邊距都是 10px | 默認值: | 0 | | --- | --- | | 繼承性: | no | | --- | --- | | 版本: | CSS1 | | --- | --- | | JavaScript 語法: | _object_.style.margin="10px 5px" | | --- | --- | ## 可能的值 | 值 | 描述 | | --- | --- | | auto | 瀏覽器計算外邊距。 | | _length_ | 規定以具體單位計的外邊距值,比如像素、厘米等。默認值是 0px。 | | _%_ | 規定基于父元素的寬度的百分比的外邊距。 | | inherit | 規定應該從父元素繼承外邊距。 | ## TIY 實例 [所有的邊距屬性在一個聲明中](/tiy/t.asp?f=csse_margin) 本例演示如何將所有的邊距屬性設置于一個聲明中。 ``` <html> <head> <style type="text/css"> p.margin {margin: 2cm 4cm 3cm 4cm} </style> </head> <body> <p>這個段落沒有指定外邊距。</p> <p class="margin">這個段落帶有指定的外邊距。這個段落帶有指定的外邊距。這個段落帶有指定的外邊距。這個段落帶有指定的外邊距。這個段落帶有指定的外邊距。</p> <p>這個段落沒有指定外邊距。</p> </body> </html> ``` ## 相關頁面 CSS 教程:[CSS 外邊距](/css/css_margin.asp "CSS 外邊距") HTML DOM 參考手冊:[margin 屬性](/jsref/prop_style_margin.asp "HTML DOM margin 屬性")
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看