我很想知道CSS文件中語句的執行順序。我在CSS文件中的以下CSS:CSS的執行順序
/* screen width larger than 800px */
@media screen (min-width: 800px) {
.indexphototd {
width:200px !important;
}
.indexphoto {
width:200px !important;
}
}
/* screen width larger than 1200px */
@media screen (min-width: 1200px) {
.indexphototd {
width:300px !important;
}
.indexphoto {
width:300px !important;
}
}
/* default setting */
.indexphototd {
width:500px !important;
}
.indexphoto {
width:500px !important;
}
在上面我已經宣佈2種2班的設置,在2種不同屏幕尺寸的代碼,並在那之後我已經提到2條語句,而不在限制屏幕尺寸(即默認)。
我的目標是,屏幕尺寸不屬於上述2組,它必須採用下面第3組中設置的默認值。
但我想知道默認設置是否會覆蓋特定於屏幕尺寸的設置,因爲我在最後插入了默認設置。我必須在一開始就把它放在一邊嗎?您能否讓我知道CSS中的執行順序。我知道CSS不是一種編程語言。我對網絡開發和學習所有這些微小的東西很陌生。請幫幫我。謝謝。
艾薩克
爲什麼你不測試它? –