在我正在查看的样式表中有以下几行(单独的):
.Ex1.Ex2 {
color:#333;
font-family:Verdana,Arial,sans-serif;
font-size:9pt;
font-weight:bold;
margin:24px 0 5px;
border-bottom:1px solid #333
}
{
background-color:#ffe;
border:1px solid #aaa;
color:#000;
font-family:Verdana,Arial,sans-serif;
font-size:9pt;
height:auto;
margin-top:5px
}和
.box_title_container {
height:29px;
width:225px;
margin:0 auto;
background:url(../best_images/boxts.gif);
repeat-x
}在通过W3C验证器时,两者都会返回解析错误。因为创建样式表的人在CSS方面比我有更多的经验,我可能相信这是两种类型的交叉浏览兼容性的黑客,但我不能谷歌(它现在是一个动词,对吗?)任何与此相关的东西。
至于第一行,它有两组封闭的属性,第二行有一个孤立的-x值(这个“错误”在接下来的5到6行中重复出现)。
谁能告诉我,这些是出于某种目的,还是纯粹的错误?
提前感谢!
发布于 2012-11-29 23:48:38
在第一个CSS块中,必须为第二个{}指定ID、类或HTML元素
.Ex1.Ex2 {
color:#333;
font-family:Verdana,Arial,sans-serif;
font-size:9pt;
font-weight:bold;
margin:24px 0 5px;
border-bottom:1px solid #333 /* missing ;*/
}
#IDneeded .CLASSneeed {
background-color:#ffe;
border:1px solid #aaa;
color:#000;
font-family:Verdana,Arial,sans-serif;
font-size:9pt;
height:auto;
margin-top:5px /* missing ;*/
}对于第二个,"repeat-x“是"background”的值,而不是CSS属性,只需移动;
.box_title_container {
height:29px;
width:225px;
margin:0 auto;
background:url(../best_images/boxts.gif) repeat-x;
}https://stackoverflow.com/questions/13629266
复制相似问题