CSS中可以和不可以繼承的屬性
一、無繼承性的屬性
1栅盲、display:規(guī)定元素應該生成的框的類型
2汪诉、文本屬性:
vertical-align:垂直文本對齊
text-decoration:規(guī)定添加到文本的裝飾
text-shadow:文本陰影效果
white-space:空白符的處理
unicode-bidi:設置文本的方向
3、盒子模型的屬性:width谈秫、height扒寄、margin 、margin-top拟烫、margin-right该编、margin-bottom、margin-left硕淑、border课竣、border-style、border-top-style置媳、border-right-style稠氮、border-bottom-style、border-left-style半开、border-width、border-top-width赃份、border-right-right寂拆、border-bottom-width、border-left-width抓韩、border-color纠永、border-top-color、border-right-color谒拴、border-bottom-color尝江、border-left-color、border-top英上、border-right炭序、border-bottom、border-left苍日、padding惭聂、padding-top、padding-right相恃、padding-bottom辜纲、padding-left
4、背景屬性:background、background-color耕腾、background-image见剩、background-repeat、background-position扫俺、background-attachment
5苍苞、定位屬性:float、clear牵舵、position柒啤、top、right畸颅、bottom担巩、left、min-width没炒、min-height涛癌、max-width、max-height送火、overflow拳话、clip、z-index
6种吸、生成內容屬性:content弃衍、counter-reset、counter-increment
7坚俗、輪廓樣式屬性:outline-style镜盯、outline-width、outline-color猖败、outline
8速缆、頁面樣式屬性:size、page-break-before恩闻、page-break-after
9艺糜、聲音樣式屬性:pause-before、pause-after幢尚、pause破停、cue-before、cue-after尉剩、cue辱挥、play-during
二、有繼承性的屬性
1边涕、字體系列屬性
font:組合字體
font-family:規(guī)定元素的字體系列
font-weight:設置字體的粗細
font-size:設置字體的尺寸
font-style:定義字體的風格
font-variant:設置小型大寫字母的字體顯示文本晤碘,這意味著所有的小寫字母均會被轉換為大寫褂微,但是所有使用小型大寫字體的字母與其余文本相比,其字體尺寸更小园爷。
font-stretch:對當前的 font-family 進行伸縮變形宠蚂。所有主流瀏覽器都不支持。
font-size-adjust:為某個元素規(guī)定一個 aspect 值童社,這樣就可以保持首選字體的 x-height求厕。
2、文本系列屬性
text-indent:文本縮進
text-align:文本水平對齊
line-height:行高
word-spacing:增加或減少單詞間的空白(即字間隔)
letter-spacing:增加或減少字符間的空白(字符間距)
text-transform:控制文本大小寫
direction:規(guī)定文本的書寫方向
color:文本顏色
3扰楼、元素可見性:visibility
4呀癣、表格布局屬性:caption-side、border-collapse弦赖、border-spacing项栏、empty-cells、table-layout
5蹬竖、列表布局屬性:list-style-type沼沈、list-style-image、list-style-position币厕、list-style
6列另、生成內容屬性:quotes
7、光標屬性:cursor
8旦装、頁面樣式屬性:page页衙、page-break-inside、windows阴绢、orphans
9店乐、聲音樣式屬性:speak、speak-punctuation旱函、speak-numeral、speak-header描滔、speech-rate棒妨、volume、voice-family含长、pitch券腔、pitch-range、stress拘泞、richness纷纫、、azimuth陪腌、elevation
三辱魁、所有元素可以繼承的屬性
1烟瞧、元素可見性:visibility
2、光標屬性:cursor
四染簇、內聯元素可以繼承的屬性
1参滴、字體系列屬性
2、除text-indent锻弓、text-align之外的文本系列屬性
五砾赔、塊級元素可以繼承的屬性
1、text-indent青灼、text-align