我一直在尝试更改我的 CSS 中的所有属性,以解决我当前的导航栏按钮问题,但徒劳无功。
当悬停在上面时,按钮超出了导航栏背景的高度,这是不应该的。
http://www.mohrdevelopment.com
我的 HTML:
<ul class="navigation">
<li class="current"><a href="index.html"><em class="home"/>Home</b></a></li>
<li><a href="second.html"><em class="photos"/><b>Photos</b></a></li>
<li><a href="projects.html"><em class="projects"/><b>Projects</b></a></li>
<li><a href="about.html"><em class="about"/><b>About</b></a></li>
<li><a href="contact.html"><em class="contact"/><b>Contact</b></a></li>
</ul>
我的 CSS:
body {
font-family:sans-serif;
background: url(images/background3.png);
}
.navigation {
background:#1841c8 url(Navigation/Navigation/nav_background.png);
height:40px;
margin-bottom:0px;
font-size: 0; /*remove whitespace*/
display:block;
min-width:625px;
}
.navigation li{
display:inline-block;
line-height: 40px;
font-size:16px;
}
.navigation li a{
display:block;
color:#FFFFFF;
padding: 11px 5px 15px;
}
.navigation li a em{
height:32px;
display:inline-block;
padding: 0 5px 6px 50px;
font-weight:bold;
vertical-align: middle;
background-position: 0 50%;
font-size:16px;
}
.navigation li a:hover{
color:#00CCFF;
background: url(Navigation/Navigation/nav_hover.png);
text-decoration:none;
padding: 11px 5px 10px;
}
.navigation .current a {
color:#FFFFFF;
background:url(Navigation/Navigation/nav_hover.png);
padding-bottom:11px;
}
/*Navigation bar icons*/
.navigation li a em.home {
background-image: url(Navigation/Icon_images/home.png);
background-repeat: no-repeat;
}
.navigation li a em.photos{
background-image: url(Navigation/Icon_images/Photo.png);
background-repeat: no-repeat;
}
.navigation li a em.projects{
background-image: url(Navigation/Icon_images/projects.png);
background-repeat: no-repeat;
}
.navigation li a em.about{
background-image: url(Navigation/Icon_images/about.png);
background-repeat: no-repeat;
}
.navigation li a em.contact{
background-image: url(Navigation/Icon_images/Contact.png);
background-repeat: no-repeat;
}
a {
Color:blue;
Text-decoration:none;
}
h1 {
background: url(images/Header.png);
text-indent:-9999px;
width:1092px;
height:132px;
margin:auto;
}
.content, aside {
height:600px;
}
.wrap {
margin:auto;
width:80%;
background:yellow;
}
.content {
background:teal;
float:left;
width:80%;
height:auto;
min-width:500px;
display:inline;
}
aside {
background:lightblue;
float:left;
width:20%;
min-width:125px;
display:inline;
}
aside ul {
padding-left:1px;
list-style:none;
}
ul a {
text-decoration:none;
color: #666;
}
ul a:hover {
text-decoration:underline;
color:black;
}
.sidebarli {
}
li {
list-style:none;
margin-bottom:20px;}
label {
display: block;
cursor: pointer;
color: #292929;
font-family:sans-serif;
padding-bottom:8px;
}
form ul {padding-left:0px;
}
textarea {
width:400px;
height:220px;
}