显示 div 时发生了一些非常奇怪的事情。在 IE 中,它按应有的方式显示,但在 Chrome 中,它略微向下移动。这是它在 IE 中的样子:
在 Chrome 中:
您会注意到,在 chrome 中,内容 div 略微向下移动。Chorme 为什么要这样做?
这是我的代码:
<?php include "headermysql.php"?>
<!DOCTYPE html>
<html>
<head>
<title>Home</title>
<script type = "text/javascript">
function to_login_page()
{
window.location.assign("http://127.0.0.1/sxp/login.php");
}
function to_signup_page()
{
window.location.assign("http://127.0.0.1/sxp/signup.php");
}
</script>
<link rel = "stylesheet" type = "text/css" href = "textstyles.css">
</head>
<body>
<?php include "headerhtml.php";?>
<div class = "menu">
<p>menu</p>
</div>
<div class = "content">
<?php
//irrelevant PHP code
?>
<a class = "main" href = "post.php">Post new topic</a>
</div>
<div class = "footer">
<p class = "footer">Copyright imulsion 2013</p>
</div>
</body>
</html>
CSS:
div.header
{
height:150px;
background-color:#008AC8;
}
div.menu
{
float:left;
width:200px;
height:800px;
background-color:#64BCE2
}
div.content
{
height:800px;
background-color:#F9F9D9;
}
div.footer
{
height:20px;
background-color:#008AC8;
}