响应式布局-v1.0

中间区域右侧宽为200px,左侧随窗口大小调整,直接上图,达到效果如下:



相应的代码:

<style>
	.header {
		height: 60px;
		border: 1px solid green;
		padding: 10px;
		position: relative;
		margin-bottom: 10px;
	}
	.logo {
		width: 60px;
		height: 60px;
		border: 1px solid red;
		float: left;
	}
	.user {
		width: 100px;
		height: 30px;
		border: 1px solid black;
		float: right;
		bottom: 10px;
		right: 10px;
		position: absolute;
	}
	.wrap:after {
		clear: both; 
		content: '';
		display: block;
	}
	.content-out {
		width: 100%;
		float: left;
		margin-left: -202px;
	}
	.content {
		height: 300px;
		border: 1px solid blue;
		margin-left: 202px;
		margin-right: 10px;
	}
	.aside {
		width: 200px;
		height: 300px;
		border: 1px solid red;
		float: right;
	}
	.footer {
		height: 40px;
		border: 1px solid black;
		margin-top: 10px;
	}
</style>

<div class="header">
	<div class="logo">Logo</div>
	<div class="user">用户名</div>
</div>
<div class="wrap">
	<div class="content-out">
		<div class="content">content - 自适应宽度</div>
	</div>
	<div class="aside">aside - 定宽200px</div>
</div>
<div class="footer">footer</div>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值