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= , initial-scale=1.0">
<title>学成在线</title>
<link rel="stylesheet" href="./css/index.css">
<!-- 引入css文件 -->
</head>
<body>
<!-- 头部 -->
<div class="header wrapper">
<h1>
<a href=""><img src="./images/logo.png" alt=""></a>
</h1>
<!-- 导航 -->
<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" placeholder="输入关键字">
<button></button>
</div>
<!-- 用户 -->
<div class="user">
<img src="./images/user.png" alt="">
<span>lilei</span>
</div>
</div>
<!-- body -->
<div class="banner">
<div class="wrapper">
<div class="left">
<ul>
<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="right">
<h2>我的课程表</h2>
<div class="content">
<dl>
<dt>继续学习 程序语言设计</dt>
<dd>正在学习——使用对象</dd>
</dl>
<dl>
<dt>继续学习 程序语言设计</dt>
<dd>正在学习——使用对象</dd>
</dl>
<dl>
<dt>继续学习 程序语言设计</dt>
<dd>正在学习——使用对象</dd>
</dl>
</div>
<a href="#" class="more">全部课程</a>
</div>
</div>
</div>
<!-- 精品推荐处 -->
<div class="goods">
<h2>精品推荐</h2>
<ul>
<li><a href="#">jQuery</a></li>
</ul>
<ul>
<li><a href="#">Spark</a></li>
</ul>
<ul>
<li><a href="#">MySQL</a></li>
</ul>
<ul>
<li><a href="#">JavaWeb</a></li>
</ul>
<ul>
<li><a href="#">MySQL</a></li>
</ul>
<ul>
<li><a href="#">JavaWeb</a></li>
</ul>
<a href="#" class="xingqu">修改兴趣</a>
</div>
<!-- 内容展示区域 -->
<div class="box wrapper">
<div class="title">
<h2>精品推荐</h2>
<a href="#">查看全部</a>
</div>
<div class="content clearfix">
<ul>
<li>
<a href="#">
<img src="./images/course01.png" alt="">
<h3>Think PHP 5.0 博客系统实战项目演练</h3>
<p>
<span>高级</span>
1125人在学习
</p>
</a>
</li>
<li><a href="#">
<img src="./images/course02.png" alt="">
<h3>Think PHP 5.0 博客系统实战项目演练</h3>
<p>
<span>高级</span>
1125人在学习
</p>
</a></li>
<li><a href="#">
<img src="./images/course03.png" alt="">
<h3>Think PHP 5.0 博客系统实战项目演练</h3>
<p>
<span>高级</span>
1125人在学习
</p>
</a></li>
<li><a href="#">
<img src="./images/course04.png" alt="">
<h3>Think PHP 5.0 博客系统实战项目演练</h3>
<p>
<span>高级</span>
1125人在学习
</p>
</a></li>
<li><a href="#">
<img src="./images/course05.png" alt="">
<h3>Think PHP 5.0 博客系统实战项目演练</h3>
<p>
<span>高级</span>
1125人在学习
</p>
</a></li>
<li><a href="#">
<img src="./images/course06.png" alt="">
<h3>Think PHP 5.0 博客系统实战项目演练</h3>
<p>
<span>高级</span>
1125人在学习
</p>
</a></li>
<li><a href="#">
<img src="./images/course07.png" alt="">
<h3>Think PHP 5.0 博客系统实战项目演练</h3>
<p>
<span>高级</span>
1125人在学习
</p>
</a></li>
<li><a href="#">
<img src="./images/course08.png" alt="">
<h3>Think PHP 5.0 博客系统实战项目演练</h3>
<p>
<span>高级</span>
1125人在学习
</p>
</a></li>
<li><a href="#">
<img src="./images/course08.png" alt="">
<h3>Think PHP 5.0 博客系统实战项目演练</h3>
<p>
<span>高级</span>
1125人在学习
</p>
</a></li>
<li><a href="#">
<img src="./images/course08.png" alt="">
<h3>Think PHP 5.0 博客系统实战项目演练</h3>
<p>
<span>高级</span>
1125人在学习
</p>
</a></li>
</ul>
</div>
</div>
<!-- 版权 -->
<div class="footer">
<div class="wrapper">
<div class="left">
<img src="./images/logo.png" alt="">
<p>学成在线致力于普及中国最好的教育它与中国一流大学和机构合作提供在线课程。<br>© 2017年XTCG Inc.保留所有权利。-沪ICP备15025210号</p>
<br>
<a href="#">下载APP</a>
</div>
<div class="right">
<dl>
<dt>合作伙伴</dt>
<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;
box-sizing: border-box;
}
a {
text-decoration: none;
}
li {
list-style: none;
}
.clearfix::before,.clearfix::after {
content: '';
display: table;
}
.clearfix::after {
clear: both;
}
body {
color: #f3f5f7 ;
}
.wrapper {
width: 1200px;
margin: 0 auto;
}
.header {
height: 42px;
/* background-color: pink; */
margin-top: 30px;
margin-bottom: 30px;
margin:30px auto;
}
h1 {
float: left;
}
.nav {
float: left;
margin-left: 70px;
height: 42px;
}
.nav li {
float: left;
margin-right: 26px;
}
.nav ul a {
display: block;
padding: 0 9px;
height: 42px;
line-height: 42px;
font-size: 18px;
color: #050505;
}
.nav li a:hover {
border-bottom: 2px solid #00a4ff;
}
/* 搜索 */
.search {
float: left;
margin-left: 59px;
width: 412px;
height: 40px;
border: 1px solid #00a4ff;
}
.search input {
float: left;
width: 360px;
height: 38px;
border: 0;
padding-left: 20px;
}
/* 控制placeholder里面的字体 */
.search input::placeholder {
font-size: 14px;
color: #bfbfbf;
}
/* 按钮 */
.search button {
float: left;
width: 50px;
height: 40px;
background-image: url(../images/btn.png);
border: 0;
}
.user {
float:right;
margin-right: 35px;
height: 42px;
line-height: 42px;
}
.user img {
/* 调节图片对齐方式 ,middle居中*/
vertical-align:middle;
}
/* banner部分 */
.banner {
height: 420px;
background-color: #1c036c;
}
.banner .wrapper {
height: 420px;
background-image: url(../images/banner2.png);
}
.banner .left {
padding: 0 20px;
float: left;
width: 190px;
height: 420px;
background-color: rgba(0, 0, 0, 0.3);
line-height: 44px;
/* color: #fff; */
/* 写在此处因为能继承 */
}
.banner .left a:hover {
color: #00b4ff;
}
div ul li a span {
float: right;
}
.banner .right {
float: right;
width: 228px;
height: 300px;
background-color: #fff;
margin-top: 50px;
}
.banner .right h2 {
height: 48px;
background-color: #9bceea;
text-align:center;
line-height: 48px;
font-size: 18px;
color: #fff;
}
.banner .right .content {
padding: 0 18px;
}
.banner .right .content dl {
padding: 12px 0;
border-bottom: 1px solid #000;
}
.banner .right .content dt {
font-size: 16px;
color: #4e4e4e;
}
.banner .right .content dd {
font-size: 14px;
color: #4e4e4e;
}
/* 全部课程处代码 */
.banner .right .more {
display: block;
margin: 4px auto 0;
width: 200px;
height: 40px;
border: 1px solid #00a4ff;
font-size: 16px;
color: #00a4ff;
font-weight: 700px;
text-align: center;
line-height: 40px;
}
body {
text-align: center;
}
.goods {
margin-top: 8px;
padding-left: 34px;
padding-right: 26px;
height: 60px;
width: 1200px;
/* 要想auto生效 必须设置宽度width */
background-color: #fff;
line-height: 60px;
box-shadow: 0px 2px 3px 0px rgba(118, 118, 110, 0.2);
/* 上一行代码为阴影的设计 */
margin: 8px auto;
}
.goods h2 {
float: left;
font-size: 16px;
color: #00a4ff;
font-weight: 400;
}
.goods ul {
float: left;
margin-left: 30px;
}
.goods ul li {
float: left;
}
.goods li a {
border-left: 1px solid #bfbfbf;
padding: 0 30px;
font-size: 16px;
color: #858585;
}
.goods .xingqu {
float: right;
font-size: 14px;
color: #00a4ff;
}
/* 精品课程 */
.box {
margin-top: 35px;
}
.box .title {
height: 40px;
/* background-color: pink; */
}
.box .title h2 {
float: left;
font-size: 20px;
color: #494949;
font-weight: 400;
}
.box .title a {
float: right;
font-size: 12px;
margin-right: 30px;
color: #a5a5a5;
}
.box .content li {
float: left;
width: 228px;
height: 270px;
margin-right: 15px;
margin-bottom: 15px;
background-color: #fff;
}
.box .content li:nth-child(5n) {
margin-right: 0;
}
.box .content li h3 {
padding: 20px;
font-size: 14px;
color: #050505;
font-weight: 400;
}
.box .content li p {
padding: 0 20px;
font-size: 12px;
color: #494949;
}
.box .content li span {
color: #ff7c2d
}
.footer {
height: 417px;
padding-top: 30px;
margin-top: 40px;
/* background-color: pink; */
}
.footer .wrapper .left {
float: left;
}
.footer .wrapper .left p {
margin: 20px 0 10px;
font-size: 12px;
color: #666;
}
.footer .wrapper .right {
float: right;
}
.footer .left {
text-align: left;
}
.footer .left a {
display: inline-block;
width: 120px;
height: 36px;
border: 1px solid #00a4ff;
text-align: center;
line-height: 36px;
font-size: 16px;
color: #00a4ff;
}
.footer .right dl {
float: left;
margin-left: 120px;
font-size: 16px;
color: #333;
}
.footer .right dl dt {
line-height: 21px;
padding-bottom: 14px;
text-align: left;
}
.footer .right dl dd {
font-size: 12px;
line-height: 21px;
text-align: left;
}
效果图
标签:学成,right,color,height,html,font,margin,css,left From: https://blog.51cto.com/u_15928062/5987047