七台河二手物品信息网:css文档中,css语句通用语法规则有几种?

来源:百度文库 编辑:中科新闻网 时间:2024/05/07 07:28:55
css文档中,css语句通用语法规则有几种?写出这些规则的一般形式。

一个样式表可以包含一个或多个规则
规则的第一部分叫选择器
每一个选择器都有相关的属性和值
示例:
RuleSelector{Declarationsproperty: value;
property: value;
...
}

#TheID {
/*sytle*/
}
.TheClass {
/*sytle*/
}
DIV #TheID {
/*sytle*/
}
Div.TheClass{
/*sytle*/
}
DIV#TheID a{
/*sytle*/
}
DIV#TheID span a {
/*sytle*/
}
DIV#TheID li{
/*sytle*/
}
DIV.TheClass a{
/*sytle*/
}
DIV.TheClass span a:visited{
/*sytle*/
}
............