在CSS中,每个属性只能存在一个。这是由语法所确定的。假设我们想要给一个元素同时设置背景颜色和宽度。如果我们这样写:div { backgroundcolor: blue; width: 50; ba...
在CSS中,每个属性只能存在一个。这是由语法所确定的。
假设我们想要给一个元素同时设置背景颜色和宽度。如果我们这样写:
div {
background-color: blue;
width: 50%;
background-color: red;
} div {
background-color: blue;
width: 50%;
}
div {
background-color: red;
}