您的位置:首页 > Web前端 > CSS

通过 CSS 实现一个左边固定宽度、右边自适应的两列布局

2017-02-21 23:24 507 查看
1.通过绝对定位实现

#rose{

/*width: 100%;
text-align: center;//居中*/
position: relative;
}
#rose .redRose{
/*display:inline-block;//居中*/
width:560px;
height: 280px;
background-color: red;
position: absolute;
/* margin:0 auto;//居中*/
}
#rose .whiteRose{
position: absolute;
margin-left:560px;
width: 100%;

}
#rose .yellow{
background-color: yellow;
position: absolute;
width: 100%;
height: 30px;
top:280px;
}
2. 通过浮动实现

3. 通过 BFC 规则实现
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  css 布局
相关文章推荐