第一關(guān) plate ,(plate元素)
第二關(guān) bento ,(bento元素)
第三關(guān) #fancy ,(id為fancy的元素)
第四關(guān) plate apple ,(plate祖先元素下的apple后代元素)
第五關(guān) #fancy pickle ,(id為#fancy的祖先元素下的pickle后代元素)
不第六關(guān) .small ,(組為small的元素)
第七關(guān) orange.small ,(組為small的orange元素)
第八關(guān) bento>orange.small ,(bento父元素下的組為small的orange子元素)
第九關(guān) plate,bento,div ,(plate,bento兄弟元素在div元素中)
第十關(guān) * ,(*代表所有元素)
第十一關(guān) plate>* ,(plate父元素的所有ziyuansu)
第十二關(guān) plate + apple ,(兄弟元素選擇器,plate元素的后一個元素)
第十三關(guān) bento~pickle ,(兄弟元素選擇器,bento元素后的多個pickle元素)
第十四關(guān) plate>apple ,(plate父元素下的apple子元素)
第十五關(guān) plate orange:first-child , (子元素選擇器,plate元素下的第一個orange元素)
第十六關(guān) plate :only-child,(所有plate元素下的元素)
第十七關(guān) #fancy :last-child,pickle:last-child ,(id為fancy的元素的最后一個和pickle元素的最后一個)
第十八關(guān) div plate:nth-child(3),(div元素中的第三個plate元素)
第十九關(guān) div bento :nth-last-child(4) ,(div元素中倒數(shù)第四個bento元素)
第二十關(guān) apple:first-of-type (第一個apple元素)
第二十一關(guān) plate:nth-of-type(even) ,(所有偶數(shù)個的plate元素)
第二十二關(guān) plate:nth-of-type(3),plate:nth-of-type(5) ,(plate元素下的第3個和第5個元素)
第二十三關(guān) plate apple.small:only-of-type ,(plate元素下滿足apple.small元素的唯一一個元素)
第二十四關(guān) orange.small:last-of-type,apple.small:last-of-type ,(是orange.samll和apple.small元素的最后一個元素)
第二十五關(guān) bento:empty ,(bento元素里沒有包括額外元素)
第二十六關(guān) apple:not(.small) ,(apple里沒有組是.small的元素)
css 層疊樣式表 多個樣式用 ;(分號) 隔開,
id 去指定的位置 是唯一標(biāo)識
href 指向外部css的樣式表
css的注釋 :/* ? */ (必須在style里面寫) (縮進(jìn))
Sublime 快捷方式:
ctrl + shift + s ? ? 文件另存為
ctrl + s 保存
ctrl + 回車 ? 另起一行
ctrl + shift + 回車 ?? 在上面另起一行
h2 * 數(shù)字1.... ? ? 出來多少對
ctrl + Alt + 向下箭頭 ?? 多選 ?? 多行起編輯
ctrl + / ? ? ? ? 加注釋
ctrl + shift + / ? ? ? 多行代碼注釋
ctrl + shift +k ?? 刪除一行
ctrl +z 撤銷
nth 表示第幾個? 從一開始
內(nèi)聯(lián)框架 ? ? ? ? ? ? ? ? ? 優(yōu)先級? 1000
id選擇器 ? ? ? ? ? ? ? ? ?? 優(yōu)先級? 100
類和偽類 ? ? ? ? ? ? ? ? ? 優(yōu)先級? 10
元素選擇器 ? ? ? ? ? ? ?? 優(yōu)先級? 1
通配* ? ? ? ? ? ? ? ? ? ? ? ? 優(yōu)先級 ? 0
!import ? ? 優(yōu)先級最高,盡量不用
> 表示包含 ?? ul 里面包含 li ? ? ? ? ? ? ? ?? ul>li*4
ul 是列表 ? , ? li 是包含的列表項
$代表順序出現(xiàn)的1234 ? ? ?
id 用#表示 ?? p#p$*3
塊元素 ? ? 自己獨占一行
常見的塊元素 : div ? p ? h1~h6 ? ul ? li ?? .....
dir 對頁面進(jìn)行布局的 ? ? ? style 可以在里面寫
例 :
內(nèi)聯(lián)元素也叫行內(nèi)元素,只占自己的大小,不會獨占一行
常見的行內(nèi)元素 : span? a? img ? iframe....
什么時候一行排不下就會另起一行
大多數(shù)用塊元素包含內(nèi)聯(lián)元素,a 是超鏈接 都可以包含
a 超鏈接標(biāo)簽可以包含任意元素 除了它本身
元素選擇器 : 標(biāo)簽名{} ? 例: h1{}
id 選擇器 : 語法:#p{}
類選擇器 : .p2{}
通配選擇器 : ? ? *{}