2

一周前我开始学习网页设计。我正在尝试创建一个三个相邻的 div 的网页。缩小时我的布局变得混乱。50% 的缩放级别是可以的,但是当我开始进一步缩放时,右侧边栏位于内容 div 下方。请帮忙 :(

<div id="wrapper">

    <div id="banner">
    </div>

    <div id="topnav">
    </div>

    <div id="leftsidebar1">
    </div>

    <div id="content">
    </div>

    <div id="rightsidebar1">
    </div>

    <div id="footer">
    </div>

</div>


here's the css

    #wrapper{
    width: 900px;
    margin: 0 auto;
    padding: 10px 0 0 0;
    max-height:1000px;  
}

    #banner{
width:900px;
height:150px;
background-color: #000;
-moz-border-radius-topleft: 10px;
-moz-border-radius-topright: 10px;
border-top-left-radius: 10px;
border-top-right-radius: 10px;

}

#leftsidebar1{
    float: left;
    width: 25%;
    height: 500px;
    background-color:#000;
}

#content{
    display:inline;
    width: 50%;
    height: 500px;
    background-color:#006;
    float:left;
}

#rightsidebar1{
    float:left;
    width: 25%;
    height:500px;
    background-color:#999;
}
4

1 回答 1

0

在父 div 中获取三个 div,并将其大小设置为三个浮动 div 的总大小。

于 2013-01-02T08:24:58.903 回答