css简单练习3

css简单练习3

要求:淘宝首页框架布局 参考图片如下
用div与浮动有关知识完成
在这里插入图片描述

代码实现:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			*{
				margin: 0px;
				padding: 0rem;
				}
			#box1 {
				width: 1200px;
				}
				
			.box1_left,
			.box1_center,
			.box1_right {
				float: left;
				height: 800px;
			}

			.box1_left {
				background-color: #00FFFF;
				width: 300px;
			}

			.box1_center {
				background-color:aliceblue;
				width: 600px;
				height: 800px;
			}

			.box1_right {
				background-color: crimson;
				width: 300px;
			}

			.c11 {
				float: left;
				background-color: green;
				height: 360px;
				width: 260px;
				margin: 20px 20px;
			}

			.c12 {
				float: left;
				background-color: yellow;
				height: 360px;
				width: 260px;
				margin: 20px 20px;
			}

			.c21 {
				float: left;
				background-color: red;
				height: 360px;
				width: 180px;
				margin: 20px 10px;
			}
			.c22 {
				float: left;
				background-color: lawngreen;
				height: 360px;
				width: 180px;
				margin: 20px 10px;
			}
			.c23 {
				float: left;
				background-color: salmon;
				height:360px;
				width: 180px;
				margin: 20px 10px;
			}
		</style>
	</head>
	<body>
		<div></div>
		<div id="box1">
			<div class="box1_left">
				box1
			</div>

			<div class="box1_center">

				<div>
					<div class="c11"></div>
					<div class="c12"></div>
					<div style="clear: left;"></div>
				</div>
				<div>
					<div class="c21"></div>
					<div class="c22"></div>
					<div class="c23"></div>
					<div style="clear: left;"></div>
				</div>
			</div>

			<div class="box1_right">
				box3
			</div>
			<div style="clear: left;"></div>
		</div>
	</body>
</html>

运行结果:

  • 5
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 12
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 12
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值