2015-11-06 59 views
0

当我尝试在w3c上验证自己的CSS代码时,如果已经询问了这些错误,那么会发生这些错误,但我似乎无法找到答案。固定的一些错误,但这些仍然存在。在w3c中验证时发生CSS解析错误

Parse Error <html> <head> > <title>style2.CSS</title> </head> <body> html{ background-image: url(headerimg.jpg); } 

130解析错误

<head> 
    <meta http-equiv="content-type";content="text/html";charset="UTF-8"/> 

    <title>style2.CSS</title> 

</head> 

<body> 

html{ 
background-image: url(headerimg.jpg); 


} 
header{ 

background-image: url(headerimg.jpg); 
background-position: center top; 
background-repeat: no-repeat; 
background-size:1000px 150px; 


} 

body{ 

background-image:url(bg.jpg); 
padding-left:175px; 
padding-right:175px; 
width:940px; 
} 



#text{ 

background-color:white; 
padding-top:0px;  
padding-left:20px; 
padding-right:69.5px; 
width:600px; 
padding-bottom:0px; 
display:inline-block; 


} 

#headchoix{ 

background-color:#333; 
height:50px; 

word-wrap: normal; 
padding-top:30px; 
} 
#bot{ 

float: top; 
float:right; 
background-color:#D3D3D3; 
height:713px; 
padding-left:0.1px; 
width:250px; 
} 
#top1,#top2,#top3,#top4,#top5,#top6{ 
padding-right:40px; 
color:white;  
padding-left:10px; 
font-size:150%; 
font-weight: bold; 
    text-decoration:none; 
} 
#pad{ 

float:left; 
} 
#footerchoix{ 

background-color:#333; 
width:940px; 
height:160px; 
display:inline-block; 
} 

#aside2,#aside1{ 
float:left; 
padding-right:170px; 
color:white; 
} 
#aside3{ 
float:left; 
color:white; 
} 
#aside4{ 
float:right; 
color:white; 
width:200px; 
} 


a:visited{ 
color:black; 
} 
a:hover{ 

color:red; 
} 
a:active{ 

color:yellow; 
} 

a:link{ 
color:blue; 
} 


</body> 
+0

你说的CSS,但你似乎验证HTML(与CSS代码作为内容)。 – unor

回答

0

您的元标记有错误的分号:

此:

<meta http-equiv="content-type";content="text/html";charset="UTF-8"/> 

应改为:

<meta http-equiv="content-type" content="text/html" charset="UTF-8" /> 

正如验证程序所示,在content属性之前的分号出现分析错误。那是因为你不应该用分号分隔属性。您使用空格字符来分隔属性。