CSS错误/破解和W3C验证



我正在查看的样式表中有以下行(单独的):

.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方面比我有更多的经验,我可能认为这是两种类型的跨行兼容性技巧,但我无法在谷歌上搜索(它现在是一个动词,对吧?)任何与此相关的东西。

对于第一行,它有两个封闭的属性集,第二行有一个孤立的repeat-x值(这个"错误"在接下来的5或6行中重复)。

有人能告诉我这些是出于某种目的还是纯粹的错误吗?

提前感谢!

在您的第一个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;
}

最新更新