首页 > 代码库 > DIV+CSS实现两边固定宽度,中间自适应宽度

DIV+CSS实现两边固定宽度,中间自适应宽度

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>DIV+CSS实现两边固定宽度,中间自适应宽度</title>
<style type="text/css">
.left, .right{ width: 100px; height: 100px; background-color: brown;}
.center{ height: 100px; background-color: gray; margin: 0 110px;}
.left{ float: left; margin-right: 3px;}
.right{ float: right; margin-left: 3px;}
</style>
</head>
<body>
<div class="left"></div>
<div class="right"></div>
<div class="center"></div>
</body>
</html>

DIV+CSS实现两边固定宽度,中间自适应宽度