CSS样式表:A,TD,TH和Table标签

时间:2011-07-27 21:21:26

标签: css

我的CSS问题。当我在Apple Safari中查看我的页面时,页面的样式正确。但是,当我在Google Chrome或Mozilla Firefox中查看我的页面时,该页面的样式设置不正确。主要是a,table,th和td标签在Firefox和Google Chrome中不起作用。其他一切似乎都运作良好。

这是我的样式表:

a{
margin-left:300px;
font-family:Arial, Helvetica, sans-serif;
}

br{
clear: left;
}

font{
font-family:Arial, Helvetica, sans-serif;
}

label{
font-family:Arial, Helvetica, sans-serif;
float: left;
display: block;
width: 300px;
}

legend{
color:#ff0000;
font-family:Arial, Helvetica, sans-serif;
font-weight: bold;
}

table{
margin-left:300px;
}

td{
font-family:Arial, Helvetica, sans-serif;
}

textarea{
width: 300px;
height: 150px;
}

th{
color:#ff0000;
font-family:Arial, Helvetica, sans-serif;
}

.width{
width: 300px;
}

这是我的整个HTML页面。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>ACISS | Statute Search</title>
<link rel="stylesheet" type="text/css" href="statute.css" />

</head>

<body>
<font>
Your search yielded the following results:
</font>
<table border='1'>
<tr>
<th>ACISS Statute</th>
<th>ACISS Charge</th>
<th>UCR</th>
</tr>
<?php 
while($row = mysql_fetch_array($result)){?>
<tr>
<td><?php echo $row['ACISS_statute']?></td>
<td><?php echo $row['ACISS_charge_name']?></td>
<td><?php echo $row['ACISS_UCR']?></td>
</tr>
<?php } ?>
</table>
<br />
<a href="http://localhost:80/statute_search/">Click Here to Search Again</a>

</body>
</html>

1 个答案:

答案 0 :(得分:2)

没有HTML我不能100%确定问题是什么,但我最好的猜测是它与浏览器默认设置有关。通过使用the html5 doctor reset sheet之类的内容重置它们,一切都可能看起来是相同的跨浏览器。

相关问题