页面的基本布局
1.html代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>主页</title>
<link rel="stylesheet" href="css/css1.css">
<link rel="stylesheet" href="css/common.css">
<link rel="stylesheet" href="https://at.alicdn.com/t/font_1380329_dxzei8oezwj.css">
</head>
<body>
<!--top start-->
<div class="top">
<div class="top-con">
<div class="logo"></div>
<ul class="menu">
<li class="show"><a href="javascript:void(0)">首页</a></li>
<li><a href="javascript:void(0)">在线课堂</a></li>
<li><a href="javascript:void(0)">咨询</a></li>
<li><a href="javascript:void(0)">搜索</a></li>
</ul>
<div class="reg-log">
<i class="iconfont icon-user"></i>
<a href="javascript:void(0)">登录</a>
<div>/</div>
<a href="javascript:void(0)">注册</a>
</div>
</div>
</div>
<!--top end-->
<!--middle start-->
<div class="middle">
<div class="content"></div>
</div>
<!--middle end-->
<!--bottom start-->
<div class="bottom-top">
<div class="bot-top-con"></div>
</div>
<div class="bottom">
<div class="bot-con"></div>
</div>
<!--bottom end-->
</body>
</html>
2.css代码
/*=======top=======*/
.top{
width: 100%;
height: 65px;
background: black;
}
.top .top-con{
width: 1200px;
height: 100%;
background: black;
margin: 0 auto;
color: white;
}
.top .top-con .logo{
height: 100%;
width: 235px;
background: url("https://www.python.org/static/img/python-logo.png") no-repeat 0 -5px;
float: left;
margin-right: 60px;
}
.top .top-con .menu li{
float: left;
margin-left: 20px;
height: 65px;
line-height: 65px;
box-sizing: border-box;
}
.top .top-con .menu a{
display: inline-block;
width: 80px;
height: 65px;
color: white;
text-align: center;
}
.top .top-con .menu li.show{
border-bottom: 3px solid rebeccapurple;
background: #000000;
}
.top .top-con .menu li:hover{
border-bottom: 3px solid rebeccapurple;
background: #000000;
}
.top .top-con .reg-log{
height: 65px;
line-height: 65px;
float: right;
margin-right: 20px;
}
.top .top-con .reg-log i{
font-size: 40px;
color: #6fa026;
}
.top .top-con .reg-log a{
height: 65px;
width: 40px;
color: white;
line-height: 65px;
display: block;
float: right;
text-align: center;
}
.top .top-con .reg-log div{
height: 65px;
width: 10px;
float: right;
text-align: center;
}
/*========top-end========*/
/*=======middle start=======*/
.middle{
width: 100%;
height: 800px;
background: antiquewhite;
}
.middle .content{
width: 1200px;
height: 100%;
background: white;
margin: 0 auto;
}
/*=====middle end=====*/
/*=====bottom-top start======*/
.bottom-top{
width: 100%;
height: 120px;
background: grey;
}
.bottom-top .bot-top-con{
width: 1200px;
height: 100%;
background: #775522;
margin: 0 auto;
}
/*=====bottom-top end======*/
/*=====bottom start=======*/
.bottom{
width: 100%;
background: black;
height: 60px;
}
/*=====bottom end========*/
3.css重置部分代码
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
a{
text-decoration: none;
}
4.页面效果
