html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>1220作业</title>
<link rel="stylesheet" href="font/iconfont.css">
<link rel="stylesheet" href="1220.css">
</head>
<body>
<main>
<header class="clearfix">
<!-- logo -->
<div class=" f_l logo">
<a href="">
<img src="./image/logo.png" alt="" class="logo_img">
</a>
</div>
<div class="f_r header_right">
<!-- 搜索框 -->
<div class="serach f_l">
<input type="text" placeholder="请输入关键字">
<i class="iconfont icon-jinduchaxun"></i>
</div>
<!-- icon -->
<div class="icons f_l">
<i class="iconfont icon-huiyuan1"></i>
<i class="iconfont icon-danmu1"></i>
<i class="iconfont icon-fabu"></i>
<i class="iconfont icon-sousuofangda"></i>
<i class="iconfont icon-huiyuan3"></i>
<i class="iconfont icon-dianzan"></i>
</div>
</div>
</header>
<!-- 快速导航栏 -->
<ul class="mg_t_10 clearfix">
<li class="fast_nav">
<div class="fast_nav_left f_l">
<i class="iconfont icon-gongdan red fontsize_32"></i>
<div class="f_r">
<a href="" class="nav_item block">资讯</a>
<a href="" class="nav_item block">学习</a>
</div>
</div>
<div class="fast_nav_right f_l">
<ul class="son_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>
</ul>
</div>
</li>
<li class="fast_nav">
<div class="fast_nav_left f_l">
<i class="iconfont icon-gongdan red fontsize_32"></i>
<div class="f_r">
<a href="" class="nav_item block">资讯</a>
<a href="" class="nav_item block">学习</a>
</div>
</div>
<div class="fast_nav_right f_l">
<ul class="son_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>
</ul>
</div>
</li>
<li class="fast_nav">
<div class="fast_nav_left f_l">
<i class="iconfont icon-gongdan red fontsize_32"></i>
<div class="f_r">
<a href="" class="nav_item block">资讯</a>
<a href="" class="nav_item block">学习</a>
</div>
</div>
<div class="fast_nav_right f_l">
<ul class="son_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>
</ul>
</div>
</li>
<li class="fast_nav">
<div class="fast_nav_left f_l">
<i class="iconfont icon-gongdan red fontsize_32"></i>
<div class="f_r">
<a href="" class="nav_item block">资讯</a>
<a href="" class="nav_item block">学习</a>
</div>
</div>
<div class="fast_nav_right f_l">
<ul class="son_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>
</ul>
</div>
</li>
</ul>
<!-- 图片区 -->
<div class="imgs clearfix">
<div class="img_l f_l mg_r_15">
<img src="./image/2.jpg" alt="">
</div>
<div class="img_r f_l">
<img src="./image/banner-right.jpg" alt="">
</div>
</div>
</main>
</body>
</html>
CSS
* {
margin: 0;
padding: 0;
}
body {
padding-top: 50px;
}
main {
width: 1200px;
margin: 0 auto;
}
li{
list-style: none;
}
a {
text-decoration: none;
color: #333;
}
.f_r{
float: right;
}
.f_l {
float: left;
}
.mg_t_10{
margin-top: 10px;
}
.mg_r_15{
margin-right: 15px;
}
.block{
display: block;
}
.fontsize_32{
font-size: 40px;
}
.clearfix:after,.clearfix:before{
content: "";
display: table;
}
.clearfix:after{
clear: both;
}
.clearfix{
*zoom: 1;
}
.red {
color: red;
}
.logo{
height: 76px;
}
.logo>img{
display: block;
height: 100%;
}
.header_right{
margin-top: 28px;
}
.serach{
position: relative;
z-index: 1;
height: 30px;
width: 300px;
border: 1px solid #ccc;
border-radius: 10px;
overflow: hidden;
}
.serach:hover{
box-shadow: 0px 0px 5px #ccc;
}
.serach>input{
width: 100%;
height: 100%;
display: block;
border: none;
border-radius: 10px;
outline: none;
text-indent: 10px;
padding-right: 10px;
}
.icon-jinduchaxun{
position: absolute;
right: 5px;
top: calc(50% - 7.5px);
width: 15px;
height: 15px;
font-size: 15px;
}
.icons {
margin-left: 50px;
}
.icons>i{
width: 50px;
height: 50px;
margin-right: 15px;
font-size: 30px;
}
.icons>i:hover{
color: red;
}
.fast_nav{
margin-right: 0px;
width: 300px;
float: left;
}
.fast_nav_left{
padding-right: 10px;
border-right: 1px solid #ccc;
box-sizing: border-box;
}
.son_ul{
width: 200px;
margin-left: 10px;
}
.son_ul>li{
float: left;
width: 35px;
margin-right: 10px;
}
.son_ul>li>a{
display: block;
text-align: center;
}
.imgs {
margin-top: 30px;
}
.imgs img{
display: block;
}
.img_l{
width: 850px;
margin-right: 50px;
}
.img_l>img{
width: 100%;
}
.img_l:hover{
box-shadow: 0px 0px 50px #ccc;
}
.img_r>img{
height: 300px;
display: block;
}
.img_r:hover{
box-shadow: 0px 0px 50px #ccc;
}