为什么我的div之间有差距?

时间:2013-07-15 01:35:29

标签: css html navbar

我确定一行代码会改变这一点,但有人能告诉我为什么我的div之间存在“关于”和“最新”之间的差距?我已经将margin和padding放到0太多的位置了。感谢:

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;
}

1 个答案:

答案 0 :(得分:0)

在你的css课程中。删掉;

display:inline-block