html和CSS创建盒子模型

html和CSS创建盒子模型

实现以下效果
在这里插入图片描述
HTML文件

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>布局</title>
	<link rel="stylesheet" href="css.css"></head>
<body>
	<div id="t1">
		<div id="div1">
			<div id="leftDiv"></div>
			<div id="rightDiv">
				<div id="upDiv1"></div>
				<div id="upDiv2"></div>
			</div>
		</div>
		<div id="div4">
			<div id="m1"></div>
			<div id="m2">
				<div id="mm1">
					<div id="blueDiv">
						<div id="blue1"></div>
						<div id="blue2"></div>
						<div id="blue3"></div>
					</div>
					<div id="purpleDiv"></div>
				</div>
				<div id="mm2"></div>
			</div>

		</div>
		<div id="bottomDiv"></div>
		<div></body>
		</html>

CSS文件

#t1{
	width: 970px;
	heigth: 600px;
	margin-left: 100px;
}
#div1{
	width: 970px;
	height: 103px;
}
#leftDiv{
	float: left;
	width: 277px;
	height: 103px;
	background-color: #DC143C;
}
#rightDiv{
	float:left;
	width: 679px;
	height: 103px;
	margin-left: 14px;
}
#upDiv1{
	width: 137px;
	height: 49px;
	margin-left: 542px;
	margin-bottom: 8px;
	background-color: #7FFF00;
}
#upDiv2{
	width: 669px;
	height: 46px;
	margin-left: 10px;
	background-color: #7FFF00;
}
#div4{
	margin-top:10px;
	width: 970px;
	height: 435px;
}
#m1{
	float:left;
	width: 310px;
	height: 435px;
	background-color: #FFD700;
}
#m2{
	float:left;
	width: 660px;
	height: 435px;
}
#blueDiv{
	float:left;
	width: 450px;
	height: 400px;
}
#blue1{
	width: 450px;
	height: 240px;
	background-color: #1E90FF;
}
#blue2{
	width: 450px;
	height: 110px;
	margin-top: 10px;
	margin-bottom: 10px;
	background-color: #1E90FF;
}
#blue3{
	width: 450px;
	height: 30px;
	background-color: #1E90FF;
}
#purpleDiv{
	float:left;
	width: 190px;
	height: 400px;
	margin-left: 10px;
	background-color: #FF00FF;
}
#mm1{
	margin-left:10px;
	width: 650px;
	height: 400px;
}
#mm2{
	width: 650px;
	height: 25px;
	margin-left:10px;
	margin-top:10px;
	background-color: #228B22;
}

#bottomDiv{
	width: 970px;
	height: 35px;
	margin-top: 10px;
	background-color: #ff00ff;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值