【发布时间】:2016-01-16 05:52:40
【问题描述】:
我是全新的 CSS 新手,并且正在使用 Dreamweaver cs6。我的菜单按钮和 Firefox 中的主要内容之间存在差距,但在 ie 中没有。任何建议将不胜感激。我可以填补 Firefox 中的空白,但后来我在 IE 中得到了重叠。我正试图让它们齐平。
这是我的html代码:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>home</title>
<style type="text/css">
body {
background-color: #06F;
background-image: url(Images/Website_Images/Banners/bg-banner-blue.png);
}
#header {
background-repeat: no-repeat;
background-position: center;
height: 40px;
z-index: 1;
position: relative;
top: 0px;
padding: 0px;
margin: 0px;
clear: both;
float: none;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
width: auto;
}
</style>
<link href="Main_MenuCSS.css" rel="stylesheet" type="text/css" />
<link href="Main_BodyCSS.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header"></div>
<div id="Navbar">
<div id="holder">
<ul>
<li><a href="index.html" id="onlink">Home</a></li>
<li><a href="services.html">Services</a></li>
<li><a href="about_us.html">About Us</a></li>
<li><a href="portfolio.html">Portfolio</a></li>
<li><a href="contact_us.html">Contact Us</a></li>
</ul>
</div><!-- end holder -->
</div><!-- end navbar -->
<div id="body">Main Body Here</div>
<div id="footer">Footer Here</div>
</body>
</html>
这是我的 CSS:
#Navbar {
width: 760px;
margin-left: auto;
margin-right: auto;
margin-top: 25px;
}
#Navbar #holder {
height:64px;
border-bottom:1px solid #000;
width: 755px;
padding-left:25px;
}
#Navbar #holder ul {
list-style:none;
margin:0;
padding:0;
}
#Navbar #holder ul li a {
text-decoration: none;
float: left;
margin-right: 5px;
font-family: "Arial Black", Gadget, sans-serif;
color: #FFF;
border: 1px solid #000;
border-bottom: 1px solid #000;
padding: 20px;
width: 100px;
text-align: center;
display: block;
background: #69f;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
}
#Navbar #holder ul li a:hover {
background:#F90;
color:FFF;
text-shadow:1px 1px 1px #000;
}
#holder ul li a#onlink{
background: #fff;
color: #000;
border-bottom: 1px solid #FFF;
}
#holder ul li a#onlink:hover {
background:#FFF;
color:#69F;
text-shadow:1px 1px 1px #000;
}
【问题讨论】:
-
我在这里做了一个小提琴:jsfiddle.net/clovola/xx5jyq6b。您可以通过降低
#holder的高度在FireFox 中修复它。不过,这可能会在 IE 中破坏它:) -
@cpdproxy:提及您正在测试的 Firefox 和 IE 版本会很有帮助。
标签: html css internet-explorer firefox