ps切图
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>首页</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="header w">
<!-- logo -->
<div class="logo">
<img src="images/logo.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><img src="images/btn.png"></button>
</div>
<div class="user">
<img src="images/user.png">qq-lilei
</div>
</div>
<div class="banner">
<div class="w">
<div class="subnav">
<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="#">前端开发 <span>></span></a></li>
<li> <a href="#">前端开发 <span>></span></a></li>
</ul>
</div>
<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="#" class="more">全部课程</a>
</div>
</div>
</div>
</div>
<div class="goods w">
<h3> 精品推荐</h3>
<ul>
<li><a href="#">jqery</a></li>
<li><a href="#">jqery</a></li>
<li><a href="#">jqery</a></li>
<li><a href="#">jqery</a></li>
<li><a href="#">jqery</a></li>
</ul>
<a href="#" class="mod">修改兴趣</a>
</div>
<div class="box w">
<div class="box-hd">
<h3> 精品推荐</h3>
<a href="#">查看全部</a>
</div>
<div class="box-bd">
<ul class="clearfix">
<li><img src="images/pic.png" alt="">
<h4>项目演练</h4>
<div class="info">
<span>高级</span> * 1125人在学习
</div>
</li>
<li><img src="images/pic.png" alt="">
<h4>项目演练</h4>
<div class="info">
<span>高级</span> * 1125人在学习
</div>
</li>
<li><img src="images/pic.png" alt="">
<h4>项目演练</h4>
<div class="info">
<span>高级</span> * 1125人在学习
</div>
</li>
<li><img src="images/pic.png" alt="">
<h4>项目演练</h4>
<div class="info">
<span>高级</span> * 1125人在学习
</div>
</li>
<li><img src="images/pic.png" alt="">
<h4>项目演练</h4>
<div class="info">
<span>高级</span> * 1125人在学习
</div>
</li>
<li><img src="images/pic.png" alt="">
<h4>项目演练</h4>
<div class="info">
<span>高级</span> * 1125人在学习
</div>
</li>
<li><img src="images/pic.png" alt="">
<h4>项目演练</h4>
<div class="info">
<span>高级</span> * 1125人在学习
</div>
</li>
<li><img src="images/pic.png" alt="">
<h4>项目演练</h4>
<div class="info">
<span>高级</span> * 1125人在学习
</div>
</li>
<li><img src="images/pic.png" alt="">
<h4>项目演练</h4>
<div class="info">
<span>高级</span> * 1125人在学习
</div>
</li>
<li><img src="images/pic.png" alt="">
<h4>项目演练</h4>
<div class="info">
<span>高级</span> * 1125人在学习
</div>
</li>
</ul>
</div>
</div>
<div class="footer">
<div class="w">
<div class="copyright">
<img src="images/logo.png" alt="">
<p>12144125436456asda </p>
<a href="#" class="app"> 下载app</a>
</div>
<div class="links">
<dl>
<dt>关于学成网</dt>
<dd><a href="#">关于</dd>
<dd><a href="#">关于</dd>
<dd><a href="#">关于</dd>
<dd><a href="#">关于</dd>
<dd><a href="#">关于</dd>
</dl>
<dl>
<dt>关于学成网</dt>
<dd><a href="#">关于</dd>
<dd><a href="#">关于</dd>
<dd><a href="#">关于</dd>
<dd><a href="#">关于</dd>
<dd><a href="#">关于</dd>
</dl>
<dl>
<dt>关于学成网</dt>
<dd><a href="#">关于</dd>
<dd><a href="#">关于</dd>
<dd><a href="#">关于</dd>
<dd><a href="#">关于</dd>
<dd><a href="#">关于</dd>
</dl>
</div>
</div>
</div>
</body>
</html>
css
* {
margin: 0;
padding: 0;
}
.w {
width: 1200px;
margin: auto;
}
body {
height: 5000px;
}
li {
list-style: none;
}
a {
text-decoration: none;
}
.clearfix:before,
.clearfix:after {
content: "";
display: table;
}
.clearfix:after {
clear: both;
}
.clearfix {
*zoom: 1;
}
.header {
height: 42px;
background-color: grey;
margin: 30px auto;
}
.logo {
float: left;
width: 198px;
height: 42px;
background-color: gray;
}
.nav {
float: left;
margin-left: 60px;
}
.nav ul li {
float: left;
margin: 0 15px;
}
.nav ul li a {
display: block;
height: 42px;
padding: 0 10px;
line-height: 42px;
color: black;
}
.nav ul li a:hover {
border-bottom: 2px solid #00a4ff;
color: #00a4ff;
}
.search {
float: left;
width: 412px;
height: 42px;
background-color: skyblue;
margin-left: 50px;
}
.search input {
float: left;
width: 345px;
height: 40px;
border: 1px solid #00a4ff;
color: grey;
font-size: 14px;
padding-left: 15px;
}
.search button {
float: left;
width: 50px;
height: 42px;
border: 0;
}
.user {
float: right;
line-height: 42px;
margin-right: 30px;
}
.banner {
height: 421px;
background-color: blue;
}
.banner .w {
height: 421px;
background: url(images/banner2_20190819_210028.png) no-repeat top center;
margin: auto;
}
.subnav {
float: left;
height: 421px;
width: 190px;
background: rgba( 0, 0, 0, .3);
}
.subnav ul li {
height: 45px;
line-height: 45px;
padding: 0 20px;
}
.subnav ul li a {
font-size: 14px;
color: #fff;
}
.subnav ul li a span {
float: right;
}
.subnav ul li a:hover {
color: #00a4ff;
}
.course {
float: right;
width: 230px;
height: 300px;
background-color: pink;
margin-top: 50px;
}
.course h2 {
height: 48px;
background-color: #00a4ff;
text-align: center;
/* 垂直居中 */
line-height: 48px;
font-size: 18px;
color: #fff;
}
.bd {
padding: 0 20px;
}
.bd ul li {
padding: 15px 0;
border-bottom: 1px solid #ccc;
}
.bd ul li h4 {
font-size: 16px;
color: grey;
}
.bd ul li p {
font-size: 12px;
color: grey;
}
.bd .more {
display: block;
height: 38px;
border: 1px solid #00a4ff;
text-align: center;
line-height: 38px;
color: #00a4ff;
font-size: 16px;
font-weight: 700px;
}
.goods {
height: 60px;
background-color: powderblue;
margin-top: 10px;
box-shadow: 0 2px 3px 3px rgba(0, 0, 0, .3);
line-height: 60px;
}
.goods h3 {
float: left;
margin-left: 30px;
font-size: 16px;
color: #000;
}
.goods ul {
float: left;
margin-left: 30px;
}
.goods ul li a {
padding: 0 30px;
font-size: 16px;
color: #000;
border-left: 1px solid #ccc;
}
.goods ul li {
float: left;
}
.mod {
float: right;
margin-right: 30px;
}
.box {
margin-top: 30px;
}
.box-hd {
height: 45px;
}
.box-hd h3 {
float: left;
font-size: 20px;
color: #494949;
}
.box-hd a {
float: right;
font-size: 12px;
color: #a5a5a5;
margin-right: 30px;
}
.box-bd ul {
width: 1225px;
}
.box-bd ul li {
float: left;
width: 230px;
height: 270px;
background-color: gray;
margin-right: 15px;
margin-bottom: 15px;
}
.box-bd ul li img {
width: 100%;
}
.box-bd ul li h4 {
margin: 20px 20px 20px 25px;
font-size: 14px;
color: #050505;
font-weight: 400px;
}
.box-bd .info {
margin: 0 20px 0 20px;
font-size: 12px;
color: #999;
}
.box-bd .info span {
color: salmon;
}
.footer {
height: 415px;
background-color: salmon;
}
.footer .w {
padding-top: 35px;
}
.copyright {
float: left;
}
.copyright p {
font-size: 12px;
color: #000;
margin: 20px 0 15px 0;
}
.copyright .app {
display: block;
height: 33px;
width: 118px;
border: 1px solid #00a4ff;
text-align: center;
line-height: 33px;
color: #00a4ff;
font-size: 16px;
}
.links {
float: right;
}
.links dl {
float: left;
margin-left: 16px;
}
.links dl dt {
font-size: 16px;
color: #333;
margin-bottom: 15px;
}
.links dl dd a {
font-size: 12px;
color: #333;
}