<style>
.left{
width:200px;
float:left;
background-color:pink
}
.right{
width:200px;
float:right;
background-color:pink
}
.center {margin:0 200px; background-color:lightblue}
</style>
<div class="left">左边固定宽度</div>
<div class="right">左边固定宽度</div>
<div class="center">中间自适应</div>
</head>
<body>
</html>
HOW2J公众号,关注后实时获知布最新的教程和优惠活动,谢谢。
![]()
问答区域
2018-03-17
我觉得站长错了,自适应就应该用overflow:hidden把中间变成BFC
2018-03-14
文字错误
2017-12-08
不用外边距也能做到自适应啊,站长???
2017-09-06
margin:0 200px;这是外边距简写吗?上下0 左右100?如果是简写为什么看不出效果。。。
2017-02-16
为什么右侧的div与中间的div没在一行
提问之前请登陆 |