我的div的背景顏色是不是在Chrome顯示,我得到這個錯誤在W3C CSS驗證:
CSS解析錯誤,DIV背景顏色不顯示
16 .myfiles Value Error : background-color Parse Error background-color= #e9e9e9
這是div實現:
<div class="myfiles">
<table class="center">
<h2>My Files</h2>
<?php
$dir = "./userFiles/".$login;
$files = array_diff(scandir($dir), array('..', '.'));
foreach($files as $ind_file){
?>
<tr><td><a href="<?php echo $dir."/".$ind_file;?>"><?php echo $ind_file;?></td></tr>
<?php
}
?>
</table>
</div>
這裏是我的CSS文件:
body {
margin-top: 0px;
width: 100%;
height: 100%;
background-image: url("bg.jpg");
font-family: Arial, Helvetica, sans-serif;
font-size : 14px;
}
h2{
text-align: center;
color:#C64934;
margin-bottom:5px;
}
.myfiles{
height: 50%;
background-color= #e9e9e9;
}
.center {
margin-left: auto;
margin-right: auto;
}
#save{
background: #3498db;
background-image: -webkit-linear-gradient(top, #3498db, #2980b9);
background-image: -moz-linear-gradient(top, #3498db, #2980b9);
background-image: -ms-linear-gradient(top, #3498db, #2980b9);
background-image: -o-linear-gradient(top, #3498db, #2980b9);
background-image: linear-gradient(to bottom, #3498db, #2980b9);
-webkit-border-radius: 4;
-moz-border-radius: 4;
font-family: Arial;
color: #ffffff;
font-size: 14px;
padding: 6px 30px 6px 30px;
}
#save:hover{
background: #3cb0fd;
background-image: -webkit-linear-gradient(top, #3cb0fd, #3498db);
background-image: -moz-linear-gradient(top, #3cb0fd, #3498db);
background-image: -ms-linear-gradient(top, #3cb0fd, #3498db);
background-image: -o-linear-gradient(top, #3cb0fd, #3498db);
background-image: linear-gradient(to bottom, #3cb0fd, #3498db);
}
#result {
margin-left: 80px;
border: 1px solid #cccccc;
width: 270px;
background: #E9ECEF;
font-family: Arial, Helvetica, sans-serif;
font-weight:bold;
font-size : 12px;
padding:5px;
margin-bottom:10px;
}
.text {
border: 1px solid #cccccc;
}
input::-webkit-input-placeholder{
color:grey;
}
.values{
font-family: verdana;
font-weight:normal;
font-size : 10px;
}
.key{
font-family: verdana;
font-weight:bold;
font-size : 12px;
padding-bottom:15px;
}
#nav1 {
margin-top: 0px;
list-style-type: none;
float: right;
font-weight: bold;
}
#nav1 li{
display: inline;
padding-right: 20px;
vertical-align: middle;
}
table {
display: table;
border-collapse: separate;
border-spacing: 10px;
}
a, a:visited, a:link {
color: #A21313;
text-decoration: none;
}
所以問題是,背景顏色我的.myfiles類不起作用。 我試圖通過指定div的高度來解決它,但它沒有奏效。
請幫幫我。
我很愚蠢。謝謝。 – zeee9 2014-12-05 03:07:14
@ zeee9你不傻。它發生在我們最好的人身上。 – 2014-12-05 03:14:55