1

我确信一行代码会改变这一点,但谁能告诉我为什么我的“关于”和“最新”的 div 之间存在差距?我已经将边距和填充设置为 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;
}
4

1 回答 1

0

在你的 css 类中 .about 摆脱;

display:inline-block
于 2013-07-15T01:40:47.880 回答