2013-07-15 74 views
1

我敢肯定,一行代碼會改變這一點,但任何人都可以告訴我爲什麼「關於」和「最新」的我的div之間存在差距?我已經把margin和padding設置爲0了。感謝:爲什麼我的divs之間有差距?

http://jsfiddle.net/PfdRE/

HTML:

<body> 
<div id="header" border="0"> 
    <div class="header_logo"><img src="images/logo.png" height="100px" alt="Ashley Lincoln Designs"></div> 
    <div class="header_button"><span>Contact</span></div> 
    <div class="header_button"><span>Archive</span></div> 
    <div class="header_button"><span>Latest</span></div> 
    <div class="header_button"><span>About</span></div> 
</div> 
//rest of code... 

CSS:

{ 
    margin: 0; 
    padding: 0; 
} 
body { 
    background-color: #174C4F; 
    margin: 0; 
    padding: 0; 
} 
#header { 
    width: 100%; 
    height: 100px; 
    margin: 0; 
    padding: 0; 
    background-color: #F5E9BE; 
    color: #207178; 
} 
.header_logo { 
    height: 100px; 
    margin: 0 auto; 
    padding: 0; 
    color: #207178; 
    font-family: "Verdana", Verdana, sans-serif; 
    font-size: 20px; 
    text-align: center; 
    text-transform:uppercase; 
    text-indent: 0px; 
    display:inline-block; 
    background-color: #F5E9BE; 
    float: left; 
    position:absolute; 
    left:75px; 
} 
.header_button { 
    width: 125px; 
    margin: 0 auto; 
    padding: 0; 
    color: #207178; 
    font-family: "Verdana", Verdana, sans-serif; 
    font-size: 20px; 
    text-align: center; 
    text-transform:uppercase; 
    text-indent: 0px; 
    display:inline-block; 
    background-color: #F5E9BE; 
    float: right; 
    position:relative; 
    right:75px; 
} 

回答

0
在你的CSS類

。關於擺脫;

display:inline-block