8.实战
大约 5 分钟学习笔记前端基础CSS
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<div class="hend">
<div class="head clearfix">
<div class="logo">
<img src="./image/logo.png" alt="">
</div>
<div class="nav">
<ul class="nav-ul clearfix">
<li>
<a href="#">首页</a>
</li>
<li>
<a href="#">课程</a>
</li>
<li>
<a href="#">职业规划</a>
</li>
</ul>
</div>
<div class="search">
<input type="text" class="search-text" placeholder="输入关键字">
<button class="search-button"></button>
<!-- <input type="submit" class="search-button" value=""> -->
</div>
<div class="user clearfix">
<img src="./image/touxiang.png" alt="">
qq-leishui
</div>
</div>
<br>
</div>
<div class="banner">
<div class="banner-bgc">
<div class="banner-box clearfix">
<ul class="fenglei">
<li><a href="#"> 前端开发 <span> > </span></a></li>
<li><a href="#"> 后端开发 <span> > </span></a></li>
<li><a href="#"> 移动开发 <span> > </span></a></li>
<li><a href="#"> 人工智能 <span> > </span></a></li>
<li><a href="#"> 商业预测 <span> > </span></a></li>
<li><a href="#"> 云计算&大数据 <span> > </span></a> </li>
<li><a href="#"> 运维&从测试 <span> > </span></a></li>
<li><a href="#"> UI设计 <span> > </span></a></li>
<li><a href="#"> 产品 <span> > </span></a></li>
</ul>
</div>
<div class="mycourse">
<h2>我的课程表</h2>
<div class="bd">
<ul>
<li>
<h3>继续学习 程序语言设计</h3>
<p>正在学习-使用对象</p>
</li>
<li>
<h3>继续学习 程序语言设计</h3>
<p>正在学习-使用对象</p>
</li>
<li>
<h3>继续学习 程序语言设计</h3>
<p>正在学习-使用对象</p>
</li>
</ul>
</div>
<a href="#" class="allcourse">全部课程</a>
</div>
</div>
</div>
<div class="goods clearfix">
<h5>精品推荐</h5>
<ul>
<li>JQuery</li>
<li>Spark</li>
<li>MySQL</li>
<li>JavaWeb</li>
<li>JavaWeb</li>
<li>MySQL</li>
</ul>
<a href="#">修改兴趣</a>
</div>
<div class="box">
<div class="box-hd">
<h3>精品推荐</h3>
<a href="#">查看全部</a>
</div>
<div class="box-bd">
<ul class="clearfix">
<li>
<em>
<img src="./image/new.png" alt="">
</em>
<img src="./image/course_android.png" alt="">
<h4>Android 网络图片加载框架详解</h4>
<div class="info">
<span>高级</span> · 1125人在学习
</div>
</li>
<li>
<img src="./image/course_android.png" alt="">
<h4>Android 网络图片加载框架详解</h4>
<div class="info">
<span>高级</span> · 1125人在学习
</div>
</li>
<li>
<img src="./image/course_android.png" alt="">
<h4>Android 网络图片加载框架详解</h4>
<div class="info">
<span>高级</span> · 1125人在学习
</div>
</li>
<li>
<img src="./image/course_android.png" alt="">
<h4>Android 网络图片加载框架详解</h4>
<div class="info">
<span>高级</span> · 1125人在学习
</div>
</li>
<li>
<img src="./image/course_android.png" alt="">
<h4>Android 网络图片加载框架详解</h4>
<div class="info">
<span>高级</span> · 1125人在学习
</div>
</li>
<li>
<img src="./image/course_android.png" alt="">
<h4>Android 网络图片加载框架详解</h4>
<div class="info">
<span>高级</span> · 1125人在学习
</div>
</li>
<li>
<img src="./image/course_android.png" alt="">
<h4>Android 网络图片加载框架详解</h4>
<div class="info">
<span>高级</span> · 1125人在学习
</div>
</li>
<li>
<img src="./image/course_android.png" alt="">
<h4>Android 网络图片加载框架详解</h4>
<div class="info">
<span>高级</span> · 1125人在学习
</div>
</li>
<li>
<img src="./image/course_android.png" alt="">
<h4>Android 网络图片加载框架详解</h4>
<div class="info">
<span>高级</span> · 1125人在学习
</div>
</li>
<li>
<img src="./image/course_android.png" alt="">
<h4>Android 网络图片加载框架详解</h4>
<div class="info">
<span>高级</span> · 1125人在学习
</div>
</li>
</ul>
</div>
</div>
<div class="footer">
<div class="end">
<div class="copyright">
<img src="./image/logo.png" alt="">
<p>学成在线致力于普及中国最好的教育它与中国一流大学和机构合作提供在线课程。
<br>
© 2017年XTCG Inc.保留所有权利。-沪ICP备15025210号
</p>
<button>下载app</button>
</div>
<div class="links">
<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>
<dd><a href="#">工作机会</a></dd>
<dd><a href="#">客户服务</a></dd>
<dd><a href="#">帮助</a></dd>
</dl>
</div>
</div>
</div>
</body>
</html>
CSS
* {
margin: 0;
padding: 0;
}
.clearfix:before,
.clearfix:after {
content: "";
display: table;
}
.clearfix:after {
clear: both;
}
.clearfix {
*zoom: 1;
}
body {
background-color: #f3f5f7;
}
li {
list-style: none;
}
a {
text-decoration: none;
}
.head {
height: 42px;
width: 1200px;
margin: 30px auto;
}
.logo {
float: left;
margin-right: 70px;
}
.nav-ul,
.nav-ul li {
float: left;
}
.nav-ul li {
margin: 0 15px;
}
.nav-ul li a {
display: block;
height: 42px;
font-size: 18px;
line-height: 42px;
color: #050505;
padding: 0 10px;
}
.nav a:hover {
border-bottom: 2px solid #00a4ff;
}
.search {
float: left;
width: 412px;
height: 42px;
margin-left: 50px;
}
.search .search-text {
float: left;
width: 345px;
height: 40px;
border: 1px solid #00a4ff;
border-right: 0;
font-size: 14px;
padding-left: 15px;
}
.search-button {
float: left;
width: 50px;
height: 42px;
border: 0;
background-image: url(./image/sousuo.png);
}
.user {
float: left;
margin-left: 30px;
line-height: 42px;
font-size: 14px;
color: #666;
}
.user img {
width: 30px;
height: 30px;
border-radius: 15px;
}
.banner {
height: 420px;
}
.banner-bgc {
/* float: left;
width: 360px; */
height: 420px;
background-color: #1c036c;
}
.banner .banner-box {
margin: 0 auto;
width: 1200px;
height: 420px;
background-image: url(./image/banner2.png);
}
.fenglei {
float: left;
width: 190px;
height: 420px;
/* padding: 12px 0; */
background: rgba(19, 1, 75, 0.5);
}
.fenglei li {
height: 45px;
padding: 0 20px;
}
.fenglei li a {
font-size: 12px;
color: #fff;
height: 45px;
line-height: 45px;
}
.fenglei li span {
float: right;
}
.fenglei li a:hover {
color: #00b4ff;
}
.mycourse {
float: right;
height: 300px;
width: 230px;
margin-top: 50px;
margin-bottom: 70px;
background-color: #fff;
}
.mycourse h2 {
width: 230px;
height: 48px;
background-color: #9bceea;
text-align: center;
font-size: 18px;
color: #fff;
line-height: 48px;
}
.bd ul li {
margin: 0 20px;
width: 190px;
height: 32px;
border-bottom: 2px solid #efefef;
padding: 15px 0;
}
.bd ul li h3 {
font-weight: 700;
font-size: 14px;
color: #5a5a5a;
}
.bd ul li p {
font-size: 12px;
color: #bdbdbd;
}
.allcourse {
display: block;
width: 198px;
height: 38px;
margin: 8px 14px 12px;
border: 2px solid #22b0ff;
line-height: 38px;
text-align: center;
font-size: 16px;
font-weight: 700;
color: #00a4ff;
}
.goods {
width: 1200px;
height: 20px;
margin: 10px auto;
background-color: #fff;
box-shadow: 0 3px 10px 1px #bdbdbd;
padding: 20px 0;
}
.goods h5 {
float: left;
text-align: center;
font-size: 16px;
color: #00b4ff;
border-right: 2px solid #bfbfbf;
line-height: 20px;
padding: 0 35px;
}
.goods ul li {
float: left;
text-align: center;
font-size: 16px;
border-right: 2px solid #bfbfbf;
padding: 0 35px;
}
.goods a {
font-size: 12;
float: right;
color: #00b4ff;
line-height: 20px;
margin-right: 35px;
}
.box {
width: 1200px;
margin: 0 auto;
}
.box-hd {
height: 20px;
padding: 20px 0;
}
.box-hd h3 {
height: 20px;
float: left;
font-weight: 400;
line-height: 20px;
}
.box-hd a {
float: right;
font-size: 12px;
color: #bfbfbf;
line-height: 20px;
padding-right: 30px;
}
.box-bd ul {
width: 1225px;
}
.box-bd ul li {
position: relative;
float: left;
width: 228px;
height: 270px;
background-color: #fff;
margin-right: 15px;
margin-bottom: 15px;
}
.box-bd ul li > img {
width: 100%;
}
.box-bd ul li em {
position: absolute;
top: 4px;
right: -4px;
}
.box-bd ul li h4 {
margin: 20px 20px 20px 25px;
font-size: 14px;
color: #050505;
font-weight: 400;
}
.box-bd .info {
margin: 0 20px 0 25px;
font-size: 12px;
color: #999;
}
.info span {
color: #ffbb2b;
}
.footer {
background-color: #fff;
}
.end {
width: 1200px;
height: 250px;
margin: 0 auto;
padding-top: 20px;
}
.copyright {
float: left;
margin: 20px;
}
.copyright p {
padding-top: 25px;
font-size: 12px;
color: #666;
}
.copyright button {
width: 118px;
height: 34px;
background-color: #fff;
border: 1px solid #00a4ff;
font-size: 16px;
margin-top: 17px;
}
.links {
float: right;
}
.links dl {
float: left;
margin-left: 100px;
}
.links dl dt {
font-size: 16px;
color: #333;
margin-bottom: 13px;
}
.links dl dd a {
color: #333;
font-size: 12px;
}