CSS的語法概括起來主要是有兩種,declaration 和 @rules
1.css rule: selector{declarations block}
其中每一個declaration都是一個propertys/value pair
2.At-rule
@charset
1.位於樣式表的最前面,有多個時只有第一個起作用
2.只支持在.css文件中使用
3.@charset "<charset>"; @前面不能有空格,中間只能有一個空格,必須帶雙引號
@import 'custom.css';
@media
Nested statements
@media (min-width: 801px) {
body {
margin: 0 auto;
width: 800px;
}
}
來源:https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Syntax