/file...../start/
/**css第二课*selector2.css*/
/***
测试部分代码:
selector_span.html:
不能吃辛辣食物
不能吃热性水果
*/
/**id选择器**/
#scale_font
{
font-size: 50px;
color : red;
}
/**父子选择器**/
#scale_font span
{
font-style : italic;
}
/**和scale_font有共同属性*/
#to_scale_font
{
font-style : italic;
}
/**共同的属性可以一起设置**/
#to_scale_font, #scale_font span
{
color : orange;
}
/****顺序问题**其实很好理解: 就像开发android一样,setText("xxx"),然后再setText("yyy")
一次,当然是最后一次生效啦!*
问题: 如果还有一个.style0在另一个css文件中,使用时同时:
不能吃热性水果;
那么到底选择谁? 这个主要是看你导入css的顺序决定的!
答案:【导入先后顺序决定】:
*/
.stylefirst
{
color : red;
}
.stylesecond
{
color : blue;
}
/file...../end/
阅读(933) | 评论(0) | 转发(0) |