前端学习笔记二:CSS(5)布局小练习

终于开始练习了!~ (才不是因为可以不用讲解了才高兴的)

由于是练习,先放运行结果(或者说是题目):
上半部分:
在这里插入图片描述
下半部分:
在这里插入图片描述

代码:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>布局练习</title>
	</head>
	<style type="text/css">
		*{
			margin: 0;
			padding: 0;
			
		}
		#header{
			height: 50px;
			background-color: #b3330b;
		}
		#header .head{
			height: 50px;
			width: 1005px;
			background-color: #00BFFF;
			margin: auto;
		}
		#banner{
			height: 500px;
			background-color: #008000;
		}
		#category{
			width: 1005px;
			height: 200px;
			background-color: #2D9CE1;
			margin: auto;
		}
		#category .item{
			float: left;
			border-right: dashed 2px #808080;
			width: 132px;
			height: 165px;
			padding-left: 20px;
			padding-right: 20px;
			padding-top: 10px;
			padding-bottom: 25px;
			background-color: #56E1B8;
		}
		#category .item.first{
			padding-left: 0;
		}
		#category .item.last{
			padding-right: 0;
			border-right: none;
		}
		#case{
			background-color: #c5c5c5;
			width: 1005px;
			height: 450px;
			margin: auto;
		}
		#case .title{
			height: 110px;
			width: 810px;
			background-color: #8DE34B;
			margin: auto;
			line-height: 110px;
		}
		#case .frame{
			height: 270px;
			width: 810px;
			background-color: #9370DB;
			margin: auto;
			overflow: auto;
		}
		#case .frame.item{
			height: 260px;
			width: 260px;
			float: left;
			margin-top: 6px;
			margin-left: 7.5px;
			margin-right: 7.5px;
			background-color: #B3330B;
		}
		#case .frame.item.first{
			margin-left: 0;
		}
		#case .frame.item.last{
			margin-right: 0;
		}
		#case .bottom{
			height: 70px;
			width: 810px;
			margin: auto;
			background-color: #FF0000;
			text-align: center;
		}
		#client{
			width: 1005px;
			height: 300px;
			margin: auto;
			background-color: #FFA500;
		}
		#client .title{
			width: 825px;
			height: 100px;
			line-height: 100px;
			margin: auto;
			background-color: aliceblue;
		}
		#client .frame{
			width: 830px;
			height: 150px;
			margin: auto;
			background-color: antiquewhite;
		}
		#client .frame.item{
			width: 160px;
			height: 150px;
			float: left;
			border: solid 1px #cccccc;
			margin-left: 2.5px;
			margin-right: 2.5px;
			background-color: aqua;
		}
		#client .frame.item.first{
			margin-left: 0;
		}
		#client .frame.item.last{
			margin-right: 0;
		}
		#client .bottom{
			height: 50px;
			width: 830px;
			margin: auto;
			background-color: aquamarine;
		}
	</style>
	<body>
		<div id="header">
			<div class="head">
				
			</div>
		</div>
		<div id="banner">
			
		</div>
		<div id="category">
			<div class="item first">
				
			</div>
			<div class="item">
				
			</div>
			<div class="item">
				
			</div>
			<div class="item">
				
			</div>
			<div class="item">
				
			</div>
			<div class="item last">
				
			</div>
		</div>
		<div id="case">
			<div class="title">
				Case 案例
			</div>
			<div class="frame">
				<div class="frame item first">
					
				</div>
				<div class="frame item">
					
				</div>
				<div class="frame item last">
					
				</div>
			</div>
			<div class="bottom">
				查看更多
			</div>
		</div>
		<div id="client">
			<div class="title">
				Client 客户
			</div>
			<div class="frame">
				<div class="frame item first">
					
				</div>
				<div class="frame item">
					
				</div>
				<div class="frame item">
					
				</div>
				<div class="frame item">
					
				</div>
				<div class="frame item last">
					
				</div>
			</div>
			<div class="bottom">
				
			</div>
		</div>
	</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值