gpt4 book ai didi

html - 有人能看出为什么这个导航栏在 chrome 中看起来与 IE 和 FF 不同吗?

转载 作者:行者123 更新时间:2023-11-28 13:16:32 25 4
gpt4 key购买 nike

我创建了一个简单的导航栏,您可以看到 here .我不知道为什么它在 IE 和 FF 中看起来一样,但在 Chrome 中却不同。我正在使用:

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 中间隙更大,我不知道如何设置此导航栏的样式,所以它在所有浏览器中都是一样的,任何见解都值得赞赏.

最佳答案

#nav {
width: auto;}

或者从这个类中删除宽度

关于html - 有人能看出为什么这个导航栏在 chrome 中看起来与 IE 和 FF 不同吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17363408/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com