方法一:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style>
.wrapper {
/* width: 500px; */
border: 1px solid green;
display: table;
}
.left {
display: table-cell;
background: #000;
width: 5000px
}
.right {
float: right;
width: 100px;
}
</style>
</head>
<body>
<div class="wrapper">
<div class="left">left</div>
<div class="right">right</div>
</div>
</body>
</html>
方法2:flex布局
方法3:把right写在left前面,让right右浮动;
http://jsbin.com/bovakuduxi/edit?html,css,output
网友评论