国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

directory search
簡介 更新歷史 關(guān)于樣式表 屬性 定位 布局 position z-index top right bottom left clip display float clear visibility overflow overflow-x overflow-y 尺寸 width min-width max-width height min-height max-height 外補(bǔ)白 margin margin-top margin-right margin-bottom margin-left 內(nèi)補(bǔ)白 padding padding-top padding-right padding-bottom padding-left 邊框 border border-width border-style border-color border-top border-top-width border-top-style border-top-color border-right border-right-width border-right-style border-right-color border-bottom border-bottom-width border-bottom-style border-bottom-style border-bottom-color border-left border-left-width border-left-style border-left-color border-radius border-top-left-radius border-top-right-radius border-bottom-right-radius border-bottom-left-radius box-shadow border-image border-image-source border-image-slice border-image-width border-image-outset border-image-repeat 背景 background background-color background-image background-repeat background-attachment background-position background-origin background-clip background-size 顏色 color opacity 字體 font font-style font-variant font-weight font-size font-family font-stretch font-size-adjust 文本 text-transform white-space tab-size word-break word-wrap overflow-wrap text-align text-align-last text-justify word-spacing letter-spacing text-indent vertical-align line-height text-size-adjust 文本裝飾 text-decoration text-decoration-line text-decoration-color text-decoration-style text-decoration-skip text-underline-position text-shadow 書寫模式 direction unicode-bidi writing-mode 列表 list-style list-style-image list-style-position list-style-type 表格 table-layout border-collapse border-spacing caption-side empty-cells 內(nèi)容 content counter-increment counter-reset quotes 用戶界面 appearance text-overflow outline outline-width outline-color outline-style outline-offset nav-index nav-up nav-right nav-down nav-left cursor zoom box-sizing resize ime-mode user-select pointer-events 多列 columns column-width column-count column-gap column-rule column-rule-width column-rule-style column-rule-color column-span column-fill column-break-before column-break-after column-break-inside 伸縮盒(舊) box-orient box-pack box-align box-flex box-flex-group box-ordinal-group box-direction box-lines 伸縮盒(新) flex flex-grow flex-shrink flex-basis flex-flow flex-direction flex-wrap align-content align-items align-self justify-content order 變換 transform transform-origin transform-style perspective perspective-origin backface-visibility 過渡 transition transition-property transition-duration transition-timing-function transition-delay 動畫 animation animation-name animation-duration animation-timing-function animation-delay animation-iteration-count animation-direction animation-play-state animation-fill-mode 打印 page page-break-before page-break-after page-break-inside 媒體查詢 width height device-width device-height orientation aspect-ratio device-aspect-ratio color color-index monochrome resolution scan grid Only IE scrollbar-3dlight-color scrollbar-darkshadow-color scrollbar-highlight-color scrollbar-shadow-color scrollbar-arrow-color scrollbar-face-color scrollbar-track-color scrollbar-base-color filter behavior Only webkit -webkit-text-fill-color -webkit-text-stroke -webkit-text-stroke-width -webkit-text-stroke-color -webkit-box-reflect -webkit-tap-highlight-color -webkit-user-drag -webkit-overflow-scrolling 選擇符 元素選擇符 通配選擇符(*) 類型選擇符(E) ID選擇符(E#id) 類選擇符(E.class) 關(guān)系選擇符 包含選擇符(E F) 子選擇符(E>F) 相鄰選擇符(E+F) 兄弟選擇符(E~F) 屬性選擇符 E[att] E[att="val"] E[att~="val"] E[att^="val"] E[att$="val"] E[att*="val"] E[att|="val"] 偽類選擇符 E:link E:visited E:hover E:active E:focus E:lang(fr) E:not(s) E:root E:first-child E:last-child E:only-child E:nth-child(n) E:nth-last-child(n) E:first-of-type E:last-of-type E:only-of-type E:nth-of-type(n) E:nth-last-of-type(n) E:empty E:checked E:enabled E:disabled E:target @page:first @page:left @page:right 偽對象選擇符 E:first-letter/E::first-letter E:first-line/E::first-line E:before/E::before E:after/E::after E::placeholder E::selection 語法與規(guī)則 !important /*comment*/ @import @charset @media @font-face @page @keyframes @supports 取值與單位 長度 <length> em ex ch rem vw vh vmax vmin cm mm q in pt pc px 角度 <angle> deg grad rad turn 時間 <time> s ms 頻率 <frequency> Hz kHz 布局 <fraction> <grid> fr gr 分辨率 <resolution> dpi dpcm dppx 顏色 <color> Color Name HEX RGB RGBA HSL HSLA transparent currentColor 文本 inherit initial unset <string> <url> <identifier> 函數(shù) calc() toggle() 生成內(nèi)容 counter() counters() attr() 圖像 <image> image() image-set() <gradient> linear-gradient() radial-gradient() repeating-linear-gradient() repeating-radial-gradient() 數(shù)字 <number> <integer> <percentage> 附錄 顏色關(guān)鍵字 媒體類型 CSS Hack 條件Hack 屬性級Hack 選擇符級Hack 問題和經(jīng)驗 Bugs和解決方案 技巧和經(jīng)驗 其它經(jīng)驗
characters

語法:

margin:[ <length> | <percentage> | auto ]{1,4}

默認(rèn)值:看每個獨(dú)立屬性

適用于:所有元素,除非 table | inline-table | table-caption 的表格類元素之外

繼承性:無

動畫性:是

計算值:看每個獨(dú)立屬性

相關(guān)屬性:[ margin-top ] || [ margin-right ] || [ margin-bottom ] || [ margin-left ]

取值:

auto:水平(默認(rèn))書寫模式下,margin-top/margin-bottom計算值為0,margin-left/margin-right取決于可用空間。詳見:margin系列之keyword auto

<length>:用長度值來定義外補(bǔ)白??梢詾樨?fù)值

<percentage>:用百分比來定義外補(bǔ)白。水平(默認(rèn))書寫模式下,參照其包含塊 width 進(jìn)行計算,其它情況參照 height ,可以為負(fù)值

說明:

檢索或設(shè)置對象四邊的外延邊距。

如果提供全部四個參數(shù)值,將按上、右、下、左的順序作用于四邊。

如果只提供一個,將用于全部的四邊。

如果提供兩個,第一個用于上、下,第二個用于左、右。

如果提供三個,第一個用于上,第二個用于左、右,第三個用于下。

非替代(non-Replaced)行內(nèi)元素可以使用該屬性設(shè)置左、右兩邊的外補(bǔ)??;若要設(shè)置上、下兩邊的外補(bǔ)丁,必須先使該對象表現(xiàn)為塊級或內(nèi)聯(lián)塊級。

外延邊距始終透明。

某些相鄰的margin會發(fā)生合并,我們稱之為margin折疊:

示例:

h2{margin:10px 0;}
div{margin:20px 0;}
......
<h2>這是一個標(biāo)題</h2>
<div>
<h2>這是又一個標(biāo)題</h2>
</div>

本例中,第一個h2的margin-bottom(10px),div的margin-top(20px),第二個h2的margin-top(10px)將被合并,它們之間的margin間隙最后是(20px),即取三者之間最大的那個值。

如果給上例中的div加上border的話:

示例:

h2{margin:10px 0;}
div{margin:20px 0;border:1px solid #aaa;}
......
<h2>這是一個標(biāo)題</h2>
<div>
<h2>這是又一個標(biāo)題</h2>
</div>

本例中,第一個h2的margin-bottom(10px),div的margin-top(20px)將被合并,但第二個h2的margin-top不與它們合并,因為它被border分隔,不與它們相鄰。

margin折疊常規(guī)認(rèn)知:

margin折疊只發(fā)生在塊級元素上;

浮動元素的margin不與任何margin發(fā)生折疊;

設(shè)置了屬性overflow且值不為visible的塊級元素,將不與它的子元素發(fā)生margin折疊;

絕對定位元素的margin不與任何margin發(fā)生折疊;

根元素的margin不與其它任何margin發(fā)生折疊;

對應(yīng)的腳本特性為margin。

兼容性:

ValuesIEFirefoxChromeSafariOperaiOS SafariAndroid BrowserAndroid Chrome
Basic Support6.0+2.0+4.0+3.1+3.5+3.2+2.1+18.0+

實例

<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="utf-8" />
<title>margin_CSS參考手冊_web前端開發(fā)參考手冊系列</title>
<meta name="author" content="Joy Du(飄零霧雨), dooyoe@gmail.com, www.doyoe.com" />
<style>
.test{margin:20px;background:#eee;}
</style>
</head>
<body>
<div class="test">注意我距上、右、下、左的距離</div>
</body>
</html>
	

運(yùn)行實例 ?

點(diǎn)擊 "運(yùn)行實例" 按鈕查看在線實例

Previous article: Next article: