绝对定位
css html,body{margin: 0px;height:100%;} div{height: 100%;} .left,.right {top: 0px;position: absolute;width: 200px;background-color: black;} .left {left: 0px;} .right {right: 0px;} .center {margin: 0px 200px;background-color: red;} html <div class=‘left‘></div> <div class="center"></div> <div class=‘right‘></div>
浮动
css html,body{margin: 0px;padding: 0px;height:100%;} div{height:100%;} .left,.right {width: 200px;background-color: black;} .left {float: left;} .right {float:right;} .center {margin: 0px 200px;background-color: red;} html <div class=‘left‘></div> <div class=‘right‘></div> <div class="center"></div>
时间: 2024-11-08 09:55:44