css浮动练习

学成网网页展示效果



github地址


html
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<link rel="stylesheet" href="css/xuechengwang.css">
	</head>
	<body>
		<!-- 头部高100,版心1560 -->
		<div class="header c">
			<div class="logo">
				<img src="images/logo_03.png" alt="">
			</div>
			<div class="nav">
				<ul>
					<li><a href="#">首页</a></li>
					<li><a href="#">课程</a></li>
					<li><a href="#">职业规划</a></li>
				</ul>
			</div>
			<div class="search">
				<input type="text" value="输入关键词">
				<button></button>
			</div>
			<div class="user">
				<img src="./images/photo.png" alt="">
				qq-leishui
			</div>
		</div>
		<!-- 第二个盒子高422 -->
		<div class="banner">
			<div class="c">
				<!-- 左边导航栏 -->
				<div class="subnav">
					<ul>
						<li><a href="#">前端开发&nbsp;&nbsp;&nbsp; &gt;</a></li>
						<li><a href="#">后端开发&nbsp;&nbsp;&nbsp; &gt;</a></li>
						<li><a href="#">移动开发&nbsp;&nbsp;&nbsp; &gt;</a></li>
						<li><a href="#">人工智能&nbsp;&nbsp;&nbsp; &gt;</a></li>
						<li><a href="#">商业预测&nbsp;&nbsp;&nbsp; &gt;</a></li>
						<li><a href="#">云计算&大数据&nbsp;&nbsp;&nbsp; &gt;</a></li>
						<li><a href="#">运维&测试&nbsp;&nbsp;&nbsp; &gt;</a></li>
						<li><a href="#">UI设计&nbsp;&nbsp;&nbsp; &gt;</a></li>
						<li><a href="#">产品&nbsp;&nbsp;&nbsp; &gt;</a></li>
					</ul>
				</div>
				<!-- 学习栏300*233 -->
				<div class="course">
					<h2>我的课程表</h2>
					<div class="bd">
						<ul>
							<li><h4>继续学习程序语言设计</h4><p>正在学习-使用对象</p></li>
							<li><h4>继续学习程序语言设计</h4><p>正在学习-使用对象</p></li>
							<li><h4>继续学习程序语言设计</h4><p>正在学习-使用对象</p></li>
						</ul>
						<a href="#">全部课程</a>
					</div>
				</div>
			</div>
		</div>
		<!-- 商品盒子 -->
		<div class="goods c">
		<!-- 精品推荐盒子 -->
			<h3>精品推荐</h3>
			<ul>
				<li><a href="#">JQuery</a></li>
				<li><a href="#">Sqark</a></li>
				<li><a href="#">MySQL</a></li>
				<li><a href="#">JavaWeb</a></li>
				<li><a href="#">MySQL</a></li>
				<li><a href="#">JavaWeb</a></li>
			</ul>
			<a href="#" class="mod">修改兴趣</a>
		</div>
		<div class="box c">
			<div class="hd">
				<h3>精品推荐</h3>
				<a href="#">查看全部</a>
			</div>
			<div class="bd">
				<!-- 229*271 -->
				<ul>
					<li>
						<em>
							<img src="images/hot.png" alt="">
						</em>
						<img src="./images/fir.png" alt="">
						<div class="info">
							<h3>Think PHP 5.0 博客系统实战项目演练 </h3>
							<span>高级</span>
							<p>  •  1125人在学习</p>
						</div>
					</li>
					<li>
						<img src="./images/sc.png" alt="">
						<div class="info">
							<h3>Think PHP 5.0 博客系统实战项目演练 </h3>
							<span>高级</span>
							<p>  •  1125人在学习</p>
						</div>
					</li>
					<li>
						<img src="./images/thir.png" alt="">
						<div class="info">
							<h3>Think PHP 5.0 博客系统实战项目演练 </h3>
							<span>高级</span>
							<p>  •  1125人在学习</p>
						</div>
					</li>
					<li>
						<img src="./images/four.png" alt="">
						<div class="info">
							<h3>Think PHP 5.0 博客系统实战项目演练 </h3>
							<span>高级</span>
							<p>  •  1125人在学习</p>
						</div>
					</li>
					<li>
						<img src="./images/fir.png" alt="">
						<div class="info">
							<h3>Think PHP 5.0 博客系统实战项目演练 </h3>
							<span>高级</span>
							<p>  •  1125人在学习</p>
						</div>
					</li>
					<li>
						<em>
							<img src="images/new.png" alt="">
						</em>
						<img src="./images/fir.png" alt="">
						<div class="info">
							<h3>Think PHP 5.0 博客系统实战项目演练 </h3>
							<span>高级</span>
							<p>  •  1125人在学习</p>
						</div>
					</li>
					<li>
						<img src="./images/sc.png" alt="">
						<div class="info">
							<h3>Think PHP 5.0 博客系统实战项目演练 </h3>
							<span>高级</span>
							<p>  •  1125人在学习</p>
						</div>
					</li>
					<li>
						<img src="./images/thir.png" alt="">
						<div class="info">
							<h3>Think PHP 5.0 博客系统实战项目演练 </h3>
							<span>高级</span>
							<p>  •  1125人在学习</p>
						</div>
					</li>
					<li>
						<img src="./images/four.png" alt="">
						<div class="info">
							<h3>Think PHP 5.0 博客系统实战项目演练 </h3>
							<span>高级</span>
							<p>  •  1125人在学习</p>
						</div>
					</li>
					<li>
						<img src="./images/fir.png" alt="">
						<div class="info">
							<h3>Think PHP 5.0 博客系统实战项目演练 </h3>
							<span>高级</span>
							<p>  •  1125人在学习</p>
						</div>
					</li>
				</ul>
			</div>	
		</div>
		<!-- 商品等级盒子 -->
		<div class="upbox c">
			<div class="level">
				<h3>编程入门</h3>
				<ul>
					<li><a href="#">热门</a></li>
					<li><a href="#">初级</a></li>
					<li><a href="#">中级</a></li>
					<li><a href="#">高级</a></li>
				</ul>
			</div>
			<!-- 又一个盒子 -->
			<div class="door c">
				<div class="left">
					<img src="images/php.png" alt="">
				</div>
				<div class="right">
					<div class="happy">
						<img src="images/happy.png" alt="">
					</div>
					<div class="all">
						<ul>
							<li>
								<div class="one">
									<img src="images/ugui.png" alt="">
									<div class="info">
										<h3>Android Hybrid APP开发实战 H5+原生!</h3>
										<span>高级</span>
										<p>  •  1125人在学习</p>
									</div>
								</div>
							</li>
							<li>
								<div class="one">
									<img src="images/ugui.png" alt="">
									<div class="info">
										<h3>Android Hybrid APP开发实战 H5+原生!</h3>
										<span>高级</span>
										<p>  •  1125人在学习</p>
									</div>
								</div>
							</li>
							<li>
								<div class="one">
									<img src="images/ugui.png" alt="">
									<div class="info">
										<h3>Android Hybrid APP开发实战 H5+原生!</h3>
										<span>高级</span>
										<p>  •  1125人在学习</p>
									</div>
								</div>
							</li>
							<li>
								<div class="one">
									<img src="images/ugui.png" alt="">
									<div class="info">
										<h3>Android Hybrid APP开发实战 H5+原生!</h3>
										<span>高级</span>
										<p>  •  1125人在学习</p>
									</div>
								</div>
							</li>
						</ul>
					</div> 
				
			</div>	
		</div>
		<!-- 结尾h420 -->
		<div class="footer">
			<div class="aim">
				<img src="images/logo_03.png" alt="">
				<p>学成在线致力于普及中国最好的教育它与中国一流大学和机构合作提供在线课程。
			©2017年XTCG Inc.保留所有权利。-沪ICP备15025210号</p>
				<a href="#">下载APP</a>
			</div>
			<!-- 565*260 -->
			<div class="about">
				<dl>
					<dt>关于学成网</dt>
					<dd><a href="">关于</a></dd>
					<dd><a href="">管理团队</a></dd>
					<dd><a href="">工作机会</a></dd>
					<dd><a href="">客户服务</a></dd>
					<dd><a href="">帮助</a></dd>
				</dl>
				<dl>
					<dt>新手指南</dt>
					<dd><a href="">如何注册</a></dd>
					<dd><a href="">如何选课</a></dd>
					<dd><a href="">如何拿到毕业证</a></dd>
					<dd><a href="">学分是什么</a></dd>
					<dd><a href="">考试未通过怎么办</a></dd>
				</dl>
				<dl>
					<dt>合作伙伴</dt>
					<dd><a href="">合作机构</a></dd>
					<dd><a href="">合作导师</a></dd>
				</dl>
			</div>
		</div>
	</body>
		<!-- 左侧固定的职位盒子 -->
		<!-- <div class="post">
			<ul>
				<li><a href="#">编程入门</a></li>
				<li><a href="#">编程入门</a></li>
				<li><a href="#">编程入门</a></li>
				<li><a href="#">编程入门</a></li>
				<li><a href="#">编程入门</a></li>
				<li><a href="#">编程入门</a></li>
				<li><a href="#">编程入门</a></li>
				<li><a href="#">编程入门</a></li>
				<li><a href="#">编程入门</a></li>
				<li><a href="#">编程入门</a></li>
				<li><a href="#">编程入门</a></li>
			</ul>
		</div> -->
</html>


css
* {
	   margin: 0;
	   padding: 0;
}

.c {
	width: 1200px;
	margin: 0 auto;
}

body {
	background-color: #f3f5f7;
}

a {
	text-decoration: none;
}

.header {
	height: 40px;
	margin: 30px auto;
}

.logo {
	float: left;
	width: 194px;
	height: 40px;
}

.nav {
	float: left;
	margin-left: 70px;
}

ul li {
	list-style: none;
}

.nav ul li {
	float:left;
}

.nav ul li a {
	display: block;
	height: 40px;
	line-height: 40px;
	padding: 0 15px;
	font-size: 18px;
	color: #050505;
}

.nav ul li a:hover {
	color: #00a4ff;
	border-bottom: 2px solid #00a4ff;
}

.search {
	float:left;
	margin-left: 80px;
	width: 410px;
	height: 40px;
}

.search input {
	float:left;
	width: 344px;
	height: 38px;
	padding-left: 15px;
	border: 1px solid #00a4ff;
	border-right: 0;
	color: #dfe0e2;
	font-style: 14px;
}

.search button {
	float: left;
	height: 40px;
	width: 50px;
	/* 把按钮默认边框去掉*/
	border: 0;
	background-image: url(../images/btn.png);
}

.user {
	float: right;
	margin-right: 35px;
	height: 40px;
	line-height: 40px;
	font-size: 14px;
	color:#666;	
}

.user img {
	display: inline-block;
	vertical-align:middle;
}

.banner {
	background-color: #1c036c;
	height: 420px;
}

.banner .c {
	height: 420px;
	background-image: url(../images/banner2.png);
}

.banner .c .subnav {
	float:left;
	height: 360px;
	width: 190px;
	padding: 30px 0;
	background-color: rgba(19,1,75,.3);
}

.banner .c .subnav ul li a {
	color: white;
	display:block;
	height: 40px;
	text-indent: 2em;
	font-size: 14px;
	line-height: 40px;
}

.banner .c .subnav ul li a:hover {
	background-color: #1c036c;	
	color: #00b4ff;
}

.course {
	float: right;
	margin-top: 50px;
	height: 300px;
	width: 233px;
	background-color: #fff;
}

.course h2 {
	display: block;
	height: 50px;
	line-height: 50px;
	text-align: center;
	background-color: #9bceea;
	font-size: 18px;
	color: #FFFFFF;
}

.course .bd {
	padding: 0 20px;
}
.course .bd ul li {
	padding: 15px 0;
	border-bottom: 1px solid #e7e7e7;
}

.course .bd ul li p {
	color: #e7e7e7;
	font-size: 12px;
}

.course .bd ul li h4 {
	font-size: 14px;
	font-style: normal;
	color: #d0d0d0;
	
}

.course .bd a {
	display: block;
	margin-top: 5px;
	width: 198px;
	height: 38px;
	line-height: 38px;
	text-align: center;
	border: 1px solid #9cd2ff;
	color: #9cd2ff;
}

.goods {
	height: 40px;
	line-height: 40px;
	box-shadow: 0 2px 2px 2px rgba(0,0,0,.1);
	margin-top: 10px;
	padding: 20px 0;
	background-color: #fff;	
}

.goods h3 {
	float: left;
	margin-left: 30px;
	font-size: 16px;
	color: #00a4ff;
}

.goods ul {
	float: left;
	margin-left: 30px;
}
.goods ul li {
	float: left;
	padding: 0 30px;
	border-left: 1px solid #bfbfbf;
}

.goods ul li a {
	color: #454545;
	font-size: 16px;
}

.goods ul li a:hover {
	color: #00a4ff;
}

.goods .mod {
	display: block;
	float: right;
	margin-right: 25px;
	font-size: 14px;
	color:#42b2ff;
}

.box {
	margin-top: 35px;
	height: 600px;
}

.box hd {
	height: 35px;
	line-height: 35px;
}

.box .hd h3 {
	float: left;
	font-weight: 400;
	font-size: 20px;
	color: #494949;
}

.box .hd a {
	display: block;
	float: right;
	margin-right: 22px;
	font-size: 12px;
	color: #a5a5a5;
}

.box .bd {
	height: 558px;
}

.box .bd ul {
	float: left;
	width: 1220px;
	margin-top: 20px;
}

.box .bd ul li {
	position: relative;
	float: left;
	height: 269px;
	width: 228px;
	margin: 0 15px 15px 0;
	background-color: #fff;
}

.box .bd ul li em img {
	position: absolute;
	top:4px;
	right:-4px;
}

.box .bd ul li >img {
	width: 100%;
}

.box .bd ul li .info {
	padding: 22px 20px 25px 28px;
}

.box .bd ul li .info h3{
	font-size: 14px;
	font-weight: normal;
	color:#050505;
}

.box .bd ul li .info span {
	font-size: 12px;
	color: #ff7c2d;
}

.box .bd ul li .info p {
	display: inline-block;
	font-size: 12px;
	color: #999999;
}

.upbox {
	height: 480px;
	margin-top: 45px;
}

.upbox .level {
	height: 50px;
	line-height: 50px;
}

.upbox .level h3{
	float: left;
	font-size: 20px;
	font-weight: normal;
	color: #494949;
}

.upbox .level ul{
	margin-left: 290px;
	float: left;
}

.upbox .level ul li{
	float: left;
	margin-left: 65px;
}

.upbox .level ul li a{
	font-size: 16px;
	color: #868686;
}

.upbox .level ul li a:hover {
	color: #86c7fc;
}

.upbox .door {
	margin-top: 25px;
	height: 392px;
}

.upbox .door .left {
	display: inline-block;
	float: left;
	height: 392px;
	width: 228px;
}

.upbox .door.left img {
	width: 100%;	
}

.upbox .door .right{
	float: left;
	margin-left: 15px;
	height: 392px;
	width: 957px;
}

.upbox .door .right .happy {
	float: left;
	width: 957px;
	height: 100px;
}

/* .upbox .door .right .happy img {
	width:100%;
}
 */
.upbox .door .right .all {
	float: left;
	height: 270px;
	margin-top:25px;
}

.upbox .right .all ul {
	float: left;
	width: 1000px;
}

.upbox .right .all ul li {
	float: left;
    margin-right: 14px;
}

.upbox .right .all ul li .one {
	width: 228px;
	height: 269px;
	background-color: #fff;
}

.upbox .right .all ul li .one img {
	width: 100%;
}
.upbox .right .all ul li .one .info {
	padding: 22px 20px 25px 28px;
}

.upbox .right .all ul li .one .info h3 {
	font-size: 14px;
	font-weight: normal;
	color:#050505;
}

.upbox .right .all ul li .one .info span {
	font-size: 12px;
	color: #ff7c2d;
}

.upbox .right .all ul li .one .info p {
	display: inline-block;
	font-size: 12px;
	color: #999999;
}

.footer {
	margin-top: 40px;
	height: 420px;
	width: 100%;
	background-color: #fff;
}
.footer .aim {
	float: left;
	margin: 35px 0 0 25px;
	width: 450px;
	height: 200px;
}

.footer .aim p {
	margin: 25px 0;
	font-size: 12px;
	color: #666666;
}

.footer .aim a {
	display: block;
	width: 118px;
	height: 32px;
	line-height: 32px;
	text-align: center;
	border: 1px solid #00a4ff;
	color: #00a4ff;
}

.footer .about {
	float: right;
	margin: 35px 10px 0 0;
	width: 565px;
	height: 260px;
}

.footer .about dl {
	float: left;
	margin-right: 65px;
}
.footer .about dl dt {
	color: #9e9e9e;
	font-size: 16px;
}

.footer .about dl dd a {
	margin-top: 12px;
	font-size: 12px;
	color: #333333;
}

.footer .about dl dd a:hover {
	color: #00a4ff;
}

.post {
	position: absolute;
	top: 900px;
	left: 150px;
	height: 430px;
	width: 185px;
}

.post ul li {
	margin-top: 20px;
}

.post ul li a {
	font-size: 14px;
	color: #000;
}

.post ul li a:hover {
	color: #b8ddff;
}

[github地址](https://github.com/dantongzhang/xuechengwang)

跟着b站的pink老师学习前端基础,看完视频自己敲代码练习加深记忆。


我是一只努力飞的菜鸟,大家一起加油吧。
如有错误,请指出,大家一起进步哦!
2020/08/17

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值