在HTML標(biāo)頭中,我得到了以下內(nèi)容:<head><title>Title</title><link href="styles.css" rel="stylesheet" type="text/css"/><link href="master.css" rel="stylesheet" type="text/css"/>styles.css是我的頁面專用表。master.css是我在每個項目上使用的工作表,用于覆蓋瀏覽器的默認設(shè)置。這些樣式表中哪個優(yōu)先?示例:第一張紙包含特定內(nèi)容body { margin:10px; }和相關(guān)的邊界,但是第二個包含我的重置html, body:not(input="button") { margin: 0px; padding: 0px; border: 0px;}本質(zhì)上,CSS的級聯(lián)元素在樣式表引用方面是否與典型CSS函數(shù)中的相同?意思是顯示的最后一行是?
3 回答

至尊寶的傳說
TA貢獻1789條經(jīng)驗 獲得超10個贊
應(yīng)用最具體的樣式:
div#foo {
color: blue; /* This one is applied to <div id="foo"></div> */
}
div {
color: red;
}
如果所有選擇器都具有相同的特異性,那么將使用最新的清除方法:
div {
color: red;
}
div {
color: blue; /* This one is applied to <div id="foo"></div> */
}
您的情況body:not([input="button"])更具體,因此使用其樣式。
添加回答
舉報
0/150
提交
取消