2012-09-13 2 views
1

나는 롤오버 할 때 내 탐색 버튼에 여분의 패딩이 나타나는 이유를 알아 내려고 미쳤습니다. 그것은 단지 그들의 왼쪽과 오른쪽에 나타납니다.CSS 목록 메뉴; 버튼의 롤오버에 여분의 패딩이 있습니다.

http://i179.photobucket.com/albums/w319/jdauel/Screenshot2012-09-13at25417PM.png

나는 내 CSS와 함께 할 수있는 뭔가가 생각하지만 난 더 이상 아무 생각이 : 여기 같은 모습의 스크린 샷에 대한 링크입니다. 제발 도와주세요 ??? 나는 Firebug를 사용하여 아무런 압박감없이 해결하려고 노력했다.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
<title>Farren's Photography</title> 
<style type="text/css"> 
html { 
height: 100%; 
width: 100%; 
} 
body { 
margin: 0px; 
} 
#container { 
font-family: Georgia, "Times New Roman", Times, serif; 
font-size: 1.2em; 
color: #000; 
background-color: #06F; 
text-align: left; 
padding: 0px; 
height: 650px; 
width: 960px; 
margin-right: auto; 
margin-left: auto; 
background-image: url(images/background_image.png); 
background-repeat: no-repeat; 
margin-top: 45px; 
} 
a:link { 
color: #FFF; 
} 
a:visited { 
color: #FFF; 
} 
a:hover { 
color: #FFF; 
} 
#container #logo { 
} 
#container #logo #fp-logo { 
background-image: url(images/logo.png); 
height: 137px; 
width: 408px; 
text-indent: -9999px; 
display: block; 
} 
#logo { 
height: 137px; 
width: 408px; 
position: relative; 
padding-top: 35px; 
padding-right: 0px; 
padding-bottom: 0px; 
padding-left: 35px; 
} 
#main { 
background-color: #FFF; 
min-height: 383px; 
width: 707px; 
position: relative; 
left: 217px; 
top: 16px; 
right: 36px; 
bottom: 113px; 
} 
#container #navbar { 
font-family: Georgia, "Times New Roman", Times, serif; 
font-size: 14px; 
color: #FFF; 
text-align: right; 
height: 45px; 
background-color: #CC0000; 
position: relative; 
top: 8px; 
bottom: 0px; 
left: 0px; 
right: 0px; 
} 
#container #navbar ul li a { 
text-decoration: none; 
} 
#container #navbar ul { 
list-style-type: none; 
padding-top: 16px; 
} 
#container #navbar ul li { 
display: inline; 
background-color: #280803; 
margin: 0px; 
height: 0px; 
width: 0px; 
position: relative; 
padding-top: 16px; 
padding-right: 15px; 
padding-bottom: 17px; 
padding-left: 15px; 
} 
#container #navbar ul li a:link { 
text-decoration: none; 
color: #FFF; 
} 
#container #navbar ul li a:visited { 
text-decoration: none; 
color: #FFF; 
} 
#container #navbar ul li a:hover { 
text-decoration: none; 
color: #FFF; 
background-color: #027e8e; 
padding-top: 16px; 
padding-right: 15px; 
padding-bottom: 17px; 
padding-left: 15px; 
margin: 0px; 
} 
#footer { 
font-family: Arial, Helvetica, sans-serif; 
font-size: x-small; 
height: 28px; 
position: relative; 
top: 8px; 
color: #FFF; 
font-style: italic; 
} 
</style> 
</head> 

<body> 
<div id="container"> 
<div id="logo"><a href="http://www.farrensphotography.com" title="Farren's Photography"  
target="_self" id="fp-logo">Farren's Photography</a></div><!-- end logo --> 
<div id="main"> 
<div id="content"> 
</div><!-- end content --> 
</div><!-- end main --> 
<div id="navbar"> 
<ul> 
<li><a href="index.html" target="_self">Home</a></li> 
<li><a href="portfolio.html" target="_self">Portfolio</a></li> 
<li><a href="mystyle.html" target="_self">My Style</a></li> 
<li><a href="specials.html" target="_self">Specials</a></li> 
<li><a href="pricing.html" target="_self">Pricing</a></li> 
<li><a href="contact.html" target="_self">Contact</a></li> 
</ul> 
</div> 
<!-- end navbar --> 
<div id="footer"> 
<div id="copyright">All images copyright© Farrens Photography 
</div><!-- end copyright --> 
<div id="network">Facebook button 
</div><!-- end network --> 
</div><!-- end footer --> 
</div><!-- end container --> 
</body> 
</html> 

답변

0

Demo ............................

: 여기

코드입니다

안녕하세요 지금은 그냥이

#container #navbar ul { 
list-style-type: none; 
margin:0; 
padding:0;} 

#container #navbar ul li { 
display: inline-block; 
vertical-align:top; 
    background-color: #280803; 
margin:0; 
    padding:0; 
position: relative; 

} 
#container #navbar ul li a:link { 
text-decoration: none; 
color: #FFF; 
} 
#container #navbar ul li a:visited { 
text-decoration: none; 
color: #FFF; 
} 


#container #navbar ul li a{ 
    display:block; 
    line-height:45px; 
    padding-left:10px; 
    padding-right:10px; 
} 
#container #navbar ul li a:hover { 
color: #FFF; 
background-color: #027e8e; 
} 

012처럼 귀하의 CSS를 변경

관련 문제