<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
<meta charset="UTF-8">
<title>页面实战布局</title>
<link rel="stylesheet" href="font/iconfont.css">
<style>
*{
margin: 0;
padding: 0;
}
header{
height: 1000px;
width: 1300px;
position: relative;
left: 0px;
right: 0px;
top: 0;
bottom: 0;
margin: auto;
border: 1px solid red;
}
H1{
position: relative;
top: 30px;
}
form{
position: absolute;
left: 530px;
top: 60px;
}
a{
text-decoration: none;
color: black;
}
a:hover{
color: red;
}
span{
margin-right: 10px;
font-size: 14px;
}
.ser{
width: 391px;
height: 42px;
border: 1px solid lightgrey;
border-radius: 10px;
outline: none;
}
button{
border: 0;
background-color: transparent;
display: block;
position: absolute;
left: 350px;
top: 5px;
}
.icon-sousuo2 {
font-size: 25px;
}
.icon-huiyuan1,.icon-danmu1,.icon-fabu,.icon-fangda,.icon-huiyuan2,.icon-dianzan{
font-size: 30px;
}
.icon-gongdan,.icon-renwujincheng,.icon-shiyongwendang,.icon-DOC{
font-size: 47px;
color: red;
}
.vip{
position: absolute;
left: 950px;
top: 60px;
}
.vip_a{
margin: 0 6px 0;
}
.link{
margin: 50px 0 0 0;
}
.link_one,.link_tow,.link_thr,.link_four{
width: 290px;
height: 50px;
}
.icon{
margin-left: 2px;
}
.link_tow {
position: absolute;
top: 133px;
left: 310px;
}
.link_thr{
position: absolute;
top: 133px;
left: 640px;
}
.link_four{
position: absolute;
top: 133px;
left: 960px;
}
.l-box1{
width: 40px;
height: 42px;
border-right: 3px solid lightgrey;
position: relative;
left: 50px;
top: -50px;
}
.l-box2{
width: 180px;
height: 45px;
position: relative;
left: 105px;
top: -92px;}
.text{
line-height: 18px;
}
</style>
</head>
<body>
<header>
<nav>
<H1><a href="https://www.php.cn"><img src="images/logo.png" alt=""></a></H1>
<form action="">
<label for="sch"></label>
<input type="search" class="ser" id="sch">
<button><i class="iconfont icon-sousuo2"></i></button>
</form>
<section class="vip">
<a href="##" class="vip_a"><span class="iconfont icon-huiyuan1"></span></a>
<a href="##" class="vip_a"><span class="iconfont icon-danmu1"></span></a>
<a href="##" class="vip_a"><span class="iconfont icon-fabu"></span></a>
<a href="##" class="vip_a"><span class="iconfont icon-fangda"></span></a>
<a href="##" class="vip_a"><span class="iconfont icon-huiyuan2"></span></a>
<a href="##" class="vip_a"><span class="iconfont icon-dianzan"></span></a>
</section>
</nav>
<section class="link">
<div class="link_one">
<span class="icon iconfont icon-gongdan"></span>
<div class="l-box1">
<span class="text">咨询学习</span>
</div>
<div class="l-box2">
<span><a href="">器材</a></span>
<span><a href="">大师</a></span>
<span><a href="">学员</a></span>
<span><a href="">实战</a></span>
<span><a href="">大赛</a></span>
<span><a href="">裤子</a></span>
<span><a href="">影视</a></span>
<span><a href="">其他</a></span>
</div>
</div>
<div class="link_tow">
<span class="iconfont icon-renwujincheng"></span>
<div class="l-box1">
<span class="text">爱好姐妹</span>
</div>
<div class="l-box2">
<span><a href="">器材</a></span>
<span><a href="">大师</a></span>
<span><a href="">学员</a></span>
<span><a href="">实战</a></span>
<span><a href="">大赛</a></span>
<span><a href="">裤子</a></span>
<span><a href="">影视</a></span>
<span><a href="">其他</a></span>
</div>
</div>
<div class="link_thr">
<span class="iconfont icon-shiyongwendang"></span>
<div class="l-box1">
<span class="text">咨询学习</span>
</div>
<div class="l-box2">
<span><a href="">器材</a></span>
<span><a href="">大师</a></span>
<span><a href="">学员</a></span>
<span><a href="">实战</a></span>
<span><a href="">大赛</a></span>
<span><a href="">裤子</a></span>
<span><a href="">影视</a></span>
<span><a href="">其他</a></span>
</div>
</div>
<div class="link_four">
<span class="iconfont icon-DOC"></span>
<div class="l-box1">
<span class="text">编程美女</span>
</div>
<div class="l-box2">
<span><a href="">器材</a></span>
<span><a href="">大师</a></span>
<span><a href="">学员</a></span>
<span><a href="">实战</a></span>
<span><a href="">大赛</a></span>
<span><a href="">裤子</a></span>
<span><a href="">影视</a></span>
<span><a href="">其他</a></span>
</div>
</div>
</section>
<div style="position: relative;top: 20px;">
<img src="images/4.jpg" alt="">
<img src="images/banner-right.jpg" height="320" width="370"/>
</div>
</header>
</body>
</html>
大部分用的POSITION定位标签完成,宽度没设置好,强行把图片宽度加大了,经过实战,对于相对定位与绝对定位有了一定的了解,还需要继续学习,充分使用。
然后请老师指正一下,在最后图片部分DIV标签,最开始用CLASS定义了一个类名,但是类选择器在STYLE里面不能使用定位功能,不知道是否写法有错误,最后是在属性栏里面用的定位标签。