我创建了一个简单的导航栏,您可以看到here。我不知道为什么它在IE和FF中看起来是一样的,但在Chrome中却不一样。我使用:有人可以看到为什么这个导航栏看起来与铬和IE和FF不同吗?
IE 10,FF 20和Chrome 27
下面是HTML:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Gem Training services</title>
<meta name="description" content="Gem training services">
<meta name="keywords" content="">
<meta name="author" content="Raymond Leadingham">
<meta name="dcterms.rightsHolder" content="Raymond Leadingham">
<meta name="viewport" content="width=1040" />
<link rel="shortcut icon" href="images/favicon.ico" />
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<ul id="nav">
<li><a href="index.php">Home</a></li>
<li><a href="ourexpertise.php">Our Expertise</a></li>
<li><a href="aboutus.php">About Us</a></li>
<li><a href="ourservices.php">Our Services</a></li>
<li><a href="learningmethods.php">Learning Methods</a></li>
<li ><a href="contactus.php">Contact Us</a></li>
</ul>
</body>
</html>
而CSS:
#nav {
width: 1000px;
float: left;
margin: 0 0 48px 0;
padding: 0;
list-style: none;
background-color: #f2f2f2;
border-bottom: 1px solid #ccc;
border-top: 1px solid #ccc;
}
#nav li {
float: left;
}
#nav li a {
display: block;
padding: 10px 40px;
text-decoration: none;
font-family: Arial, Helvetica, sans-serif;
color: #1C4688;
border-right: 1px solid #ccc;
}
#nav li a:hover {
color: #45176E;
background-color: #fff;
}
ul li:first-child{
border-left: 1px solid #ccc;
}
有一个在一点空隙在FF和IE中的导航栏的权利,但在Chrome浏览器中存在更大的差距,我不知道如何设计这个导航栏,所以它在所有浏览器中都是一样的,任何洞察力都是值得赞赏的。
首先你的主要CSS前添加一个复位样式 - HTTP:// meyerweb.com/eric/tools/css/reset/您的导航上也有固定的宽度。 –
我看到了,它和我的FF和Chrome一样。屏幕截图? – Naeem