CSS 实现一侧固定另一侧自适应
作者:
楼主楼主 | 来源:发表于
2018-06-04 16:05 被阅读0次<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
.block{
background:#ccc;
}
.sidebar-left{
float:left;
height:200px;
width:100px;
}
.main-right{
height:200px;
margin-left:110px;
}
.sidebar-right{
float:right;
height:200px;
width:100px;
}
.main-left{
height:200px;
margin-right:110px;
}
</style>
</head>
<body>
<div>
<div class="block sidebar-left"></div>
<div class="block main-right"></div>
</div>
<br>
<div>
<div class="block sidebar-right"></div>
<div class="block main-left"></div>
</div>
</body>
</html>
效果
本文标题:CSS 实现一侧固定另一侧自适应
本文链接:https://www.haomeiwen.com/subject/strysftx.html
网友评论