1.替換元素:元素內(nèi)容非文檔內(nèi)容直接顯示而由外部?jī)?nèi)容替換,如img,input(type指定)
2.<link>屬性media:all所有表現(xiàn)媒體/screen屏幕媒體/print打印機(jī),title生成候選樣式列表
3.@import url(eg.css)需置于其他樣式之上否則無(wú)效,可在style或樣式表中引入樣式表
4.優(yōu)先級(jí):內(nèi)聯(lián)樣式>文檔樣式表>外部樣式表
5.選擇器:
<1>選擇器分組 ,
<2>通配選擇器 *
<3>元素選擇器 h1
<4>類(lèi)選擇器 .
<5>id選擇器 #
<6>屬性選擇器
屬性:h1[a][b] 同時(shí)包含a,b屬性的h1
屬性值:h1[a=1]屬性與值匹配的選項(xiàng)
屬性值開(kāi)頭:h1[a^?=1]
屬性值結(jié)尾:h1[a$=1]
屬性值包含:h1[a*=1]
屬性值包含子串(適用于空格分隔的屬性):h1[a~=1]
屬性值前綴包含子串(適用于連字符分隔的屬性):h1[a|?=1]
<7>后代選擇器 空格
<8>父子選擇器 >
<9>相鄰兄弟選擇器 +(后面第一個(gè)兄弟元素) ~兄弟選擇器(后面所有兄弟元素)
<10>偽類(lèi)選擇器(推薦順序)
:link :visited :focus :hover :active(后三個(gè)為動(dòng)態(tài)偽類(lèi),可應(yīng)用于所有元素)
:first-child :last-child :only-child :nth-child(odd/even/2n+1...)
eg: p:first-child作為某元素的第一個(gè)p元素
E:first-of-type第一個(gè)孩子且限制是E元素 :last-of-type :nth-of-type(n) :nth-last-of-type(n)
:target為錨點(diǎn)目標(biāo)添加元素
:selection設(shè)定選定內(nèi)容樣式
:lang(語(yǔ)言)
:root整個(gè)DOM的元素定點(diǎn),即html
:not排除特定的元素
:empty比如一個(gè)列表空的那個(gè)元素
:disabled不可以使用時(shí),觸發(fā)
:read-only只讀時(shí),觸發(fā)
:read-write可讀可寫(xiě)時(shí),觸發(fā)
:checked被勾選觸發(fā)
<11>偽元素選擇器(一般用::與偽類(lèi)區(qū)分開(kāi))
::first-letter塊級(jí)元素首字母 ::first-line第一個(gè)文本行
::before ::after
(用于插入生成的內(nèi)容,content屬性,若選擇器主體為行內(nèi)元素則生成內(nèi)容不能為塊級(jí)元素)
::placeholder設(shè)置對(duì)象文字占位符的樣式
6.選擇器的特殊性(優(yōu)先級(jí));繼承;層疊
內(nèi)聯(lián)樣式 id 類(lèi)(偽類(lèi)) 元素(偽元素)
0 0 0 0
重要聲明!important
7.字體
font-family字體系列(有多個(gè)則用逗號(hào)隔開(kāi),當(dāng)字體包含空格或# $等符號(hào)則應(yīng)用引號(hào)包裹)
font-weight字體加粗:bold / bolder / lighter / normal / inherit / 100-900(400normal,700bold)
font-size字體大小:small / medium / large /smaller / larger / inherit / 百分比 / 像素
font-style字體風(fēng)格:inherit / normal / italic斜體 / oblique傾斜文本
font-variant字體變形:small-caps小型大寫(xiě)字母 / inherit / normal
font:font-style font-variant font-weight font-size / line-height font-family
(前三者任意順序且可選,字體大小和系列必選且前后位置不可變)
@font-face { font-family:‘自定義字體’;src:url(...) }
8.文本
text-indent縮進(jìn)
text-align水平對(duì)齊方式(應(yīng)用于塊級(jí)元素):left / right / center / inherit / justify兩端對(duì)齊文本
vertical-align垂直對(duì)齊(應(yīng)用于行內(nèi)元素和替換元素 表單元格) top / middle / bottom / baseline / text-bottom / text-top / sub / super / 百分?jǐn)?shù)(相對(duì)于行高) / 長(zhǎng)度值 / inherit
line-height行高
word-spacing字間隔
letter-spacing字母間隔
text-transform文本轉(zhuǎn)換:capitalize首字母大寫(xiě) / uppercase / lowercase / none / inherit
text-decoration文本裝飾:none / inherit / underline / overline / line-through / blink閃爍
text-shadow文本陰影:color顏色 x軸偏移量 y軸偏移量 blur模糊半徑
direction方向:rtl右到左 / ltr左到右 / inherit
white-space處理空白符:normal / inherit / nowrap / pre / pre-wrap / pre-line

9.垂直相鄰?fù)膺吘鄷?huì)合并。外邊距為透明,父元素顏色可透過(guò)。若邊框無(wú)設(shè)置顏色,則同元素前景色一樣(color)
10.display:none / inline / block / inline-block / list-item / table / flex / inline-flex...
11.改變純文本行的行間距的只有font-size,line-height,vertical-align
12.width,height應(yīng)用于塊級(jí)元素和替換元素
13.border-style:solid / dotted / dashed / double / outset / inset / groove / ridge / none / hidden / inherit
“border-style:solid dotted dashed double;”對(duì)應(yīng)上右下左邊框
14.border-width:thin / thick / medium / inherit
15.background-color:“color” / inherit / transparent
16.background-image:url( ) / none / inherit
17.background-repeat:repeat / no-repeat / repeat-x / repeat-y / inherit
18.background-position:left / right / bottom / top / center / 長(zhǎng)度值(偏移) / 百分比(成對(duì)出現(xiàn),代表水平垂直方向的位置,若只出現(xiàn)一個(gè)則另一個(gè)默認(rèn)為center)
19.background-attachment:scroll / fixed / inherit;
背景顯示區(qū)域background-clip:border-box/paddind-box/content-box/text;
背景原點(diǎn)background-origin:border-box/paddind-box/content-box
20.background-size:長(zhǎng)度值 / 百分比(100% 100%) / contain寬高適應(yīng)(可能失真) / cover覆蓋(可能截取)
21.float(浮動(dòng)需指定寬度,脫離文檔流,塊級(jí)元素頂上,內(nèi)聯(lián)元素圍繞 , 此時(shí)浮動(dòng)元素display值為block):left / right / inherit / none
22.clear(清除浮動(dòng)):left / right / both / inherit / none
23.position(定位):static / absolute(相對(duì)頁(yè)面) / fixed(相對(duì)視窗) / relative(偏移量) / inherit
24.min/max-height(width) , max-height重載覆蓋height , min-height重載覆蓋max-height , 多用min-height , 防止容器"塌陷"影響美觀且還能隨內(nèi)容增多而撐大 , max-height少用 , 用于限制容器內(nèi)元素 , 防止過(guò)大撐破容器
25.overflow(溢出):hidden / visible / inherit / auto / scroll (clip定義裁剪區(qū)域形狀 visibility)
26.z-index(應(yīng)用于定位元素):inherit / auto / 值
27.caption-size表格標(biāo)題位置:top / bottom
28.border-collapse表單元格邊框:separate分隔邊框 / collapse合并邊框 / inherit
29.cellspacing單元格間隔(分隔邊框時(shí)才適用,有兩個(gè)長(zhǎng)度值時(shí)表示水平與垂直間隔):長(zhǎng)度值
30.cellpadding單元格內(nèi)邊距
31.empty-cells處理空單元格(分隔邊框時(shí)才適用):show / hide / inherit
32.list-style-type列表類(lèi)型:disc / circle / square / decimal / upper-roman / lower-roman / upper-alpha / lower-alpha
33.list-style-image列表項(xiàng)圖像:url / none / inherit
34.list-style-position列表標(biāo)志位置:outside / inside / inherit
35.cursor光標(biāo):auto / default / inherit / pointer / url() / wait / help / text...
36.outline(style,width,color)輪廓:同邊框,solid...,input,select,textarea等標(biāo)簽帶有 , 不占據(jù)空間
37.內(nèi)聯(lián)元素寬高和上下內(nèi)外邊距不可設(shè)置
38.盒模型:標(biāo)準(zhǔn)模型width為content,IE模型為content+padding+border,box-sizing:content-box / border-box
39.css變量:聲明變量時(shí)變量名前要加兩根連詞線(--),var()函數(shù)用于讀取變量,第二個(gè)參數(shù)可作為默認(rèn)值
40.calc動(dòng)態(tài)計(jì)算長(zhǎng)度值:運(yùn)算符前后都需要保留一個(gè)空格,例width: calc(100% - 10px);
41.zoom:設(shè)置或檢索對(duì)象的縮放比例
42.::-webkit-input-placeholder設(shè)置input樣式
43.pointer-events:none;禁止點(diǎn)擊事件
44.user-select(除替換元素外)設(shè)置或檢索是否允許用戶選中文本:none / text / all / element
45.border-radius圓角:設(shè)50%(設(shè)為寬高一半,兼容較好)時(shí)為圓形
46.box-shadow框陰影(可設(shè)多重陰影,用逗號(hào)隔開(kāi)):x y blur 尺寸 color 內(nèi)外(inset/outset)
47.background:linear-gradient線性漸變,radial-gradient徑向漸變
48.border-image: linear-gradient...邊框漸變(iE不兼容)
49.Flow流,塊級(jí)元素自上而下,內(nèi)聯(lián)元素左上至右下 , 浮動(dòng)塊元素上下外邊距并不會(huì)合并
50.transform變換:translate(X Y)位移 / scale(值)伸縮 / skew(deg)斜切 / rotate旋轉(zhuǎn)(deg) rotateX(Y),旋轉(zhuǎn)基點(diǎn) transform-origin:left top;
51.transition動(dòng)畫(huà):transition-property動(dòng)畫(huà)屬性 / transition-duration持續(xù)時(shí)間 / transition-timing-function動(dòng)畫(huà)效果 / transition-delay延遲時(shí)間 (兼容寫(xiě)法時(shí),標(biāo)準(zhǔn)寫(xiě)法放最后)
簡(jiǎn)寫(xiě):transition: transform 2s linear 1s;
52.animation自定義動(dòng)畫(huà):animation-name動(dòng)畫(huà)名稱(chēng) / animation-duration持續(xù)時(shí)間 / animation-delay延遲時(shí)間 / animation-timing-function時(shí)間函數(shù)(ease-in-out等) / animation-fill-mode動(dòng)畫(huà)結(jié)束狀態(tài)(forwards停在結(jié)束狀態(tài),backwards停在開(kāi)始狀態(tài)) / animation-iteration-count動(dòng)畫(huà)次數(shù)(infinite無(wú)限次,值) / animation-direction動(dòng)畫(huà)路徑(alternate動(dòng)畫(huà)結(jié)束后原路返回,reverse倒序播放,alternate-reverse倒序播放結(jié)束后原路返回) / animation-play-state聲明動(dòng)畫(huà)播放狀態(tài)(running自動(dòng)播放,paused停止?fàn)顟B(tài))
@keyframes+自定義動(dòng)畫(huà)名{ }
53.animation-timing-function: linear勻速 / ease(默認(rèn))慢快慢 / ease-in低速開(kāi)始 / ease-out低速結(jié)束 / ease-in-out始末低速 / steps()階躍函數(shù) / cubic-bezier( )貝塞爾曲線
54.-webkit-filter濾鏡grayscale(0~1)灰度
55.-webkit-touch-callout:none 禁用系統(tǒng)默認(rèn)菜單
-webkit-text-size-adjust:none 字體縮放設(shè)置
56.word-wrap長(zhǎng)單詞換行:normal只在允許的斷字點(diǎn)換行 / break-word在長(zhǎng)單詞或 URL 地址內(nèi)部進(jìn)行換行
57.word-break規(guī)定自動(dòng)換行的處理方法:normal / break-all允許在單詞內(nèi)換行 / keep-all只能在半角空格或連字符處換行 參考:https://www.cnblogs.com/dfyg-xiaoxiao/p/9640422.html