代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.er{
width: 640px;
/*background-color: pink;*/
}
.er > div {
float: left;
}
.left-box {
width: 538px;
height: 34px;
/*background-color: greenyellow;*/
border: 1px solid #3385ff;
}
.right-box {
height: 36px;
width: 100px;
background-color: cornflowerblue;
text-align: center;
line-height: 36px;
color: #fff;
}
input {
outline: none;
border: 0;
height: 32px;
width: 500px;
margin-left: 5px;
}
.ding{
height: 50px;
width: 100%;
border-bottom:solid 1px lightgray;
}
.ding .center{
float: left;
}
.ding img{
float: left;
line-height: 50px;
}
.ding .wen{
height: 50px;
text-align: right;
}
.ding .wen span{
margin: 0 5px;
line-height: 50px;
}
.dao{
height: 40px;
width: 100%;
background-color: rgb(248,248,248);
}
.dao .kon{
height: 40px;
width: 10%;
float: left;
}
.dao .han{
height: 40px;
width: 50%;
float: left;
}
.dao .han span{
line-height: 40px;
margin-left: 15px;
}
.di{
height: 800px;
width: 100%;
}
.di >.d_left{
height: 100%;
width: 10%;
float: left;
}
.di >.d_center{
height: 100%;
width: 60%;
border-right:solid 2px gray ;
float: left;
}
.di >.d_center p{
font-size: 12px;
margin-top: -3px;
}
.dc{
height: 150px;
width: 80%;
}
.dc .dc_left{
height: 100%;
width: 20%;
float: left;
}
.dc .dc_right{
height: 179px;
width: 80%;
float: left;
}
.d_right{
height: 200px;
width: 29.5%;
float: right;
}
.d_right .dr_center div{
height:279px;
width: 30%;
float:left;
text-align: center;
font-size: 12px;
}
.d_right .dr_center p{
margin: 3px;
}
.d_right .dr_center span a{
color: blue;
}
</style>
</head>
<body>
<div class="san">
<!--顶部-->
<div class="ding">
<img src="baidu.jpg" alt="" height="40" width="10%">
<div class="center" >
<div class="er">
<div class="left-box">
<input type="text">
<img src="" alt="">
</div>
<div class="right-box">
百度一下
</div>
</div>
</div>
<div class="wen">
<span>百度首页</span>
<span>设置</span>
<span>登录</span>
</div>
</div>
<!--导航-->
<div class="dao">
<div class="kon"></div>
<div class="han">
<span>网页</span>
<span>资讯 </span>
<span>视频 </span>
<span>图片 </span>
<span>知道 </span>
<span>文库</span>
<span>贴吧</span>
<span>采购 </span>
<span>地图 </span>
<span>更多»</span>
</div>
</div>
<!--主体-->
<div class="di">
<div class="d_left"></div>
<div class="d_center">
<p>百度为您找到相关结果约54 更多</p>
<div class="dc">
<div class="dc_top"><a href=""><h3><span style="color: red">百度</span>一下,你就知道</h3></a></div>
<div class="dc_left">
<img src="u=357489844,4049484276&fm=26&gp=0.jpg" alt="" height="90%" width="100%">
</div>
<div class="dc_right">通常情况下,我们用空格键来打出多个空格,而在编写代码时,通过空格键、Tab键以及回车键打出的空格,都会被HTML(超文本标记语言)自动忽略。HTML将这样的键视为空白字符,并显示为单个空白间隔。尽管CSS提供了多种样式的空格和缩进,但是在HTML中也有一些工具可以让你自己定义空格。</div>
</div>
<div class="dc">
<div class="dc_top"><a href=""><h3><span style="color: red">百度</span>一下,你就知道</h3></a></div>
<div class="dc_left">
<img src="baidu.jpg" alt="" height="90%" width="100%">
</div>
<div class="dc_right">通常情况下,我们用空格键来打出多个空格,而在编写代码时,通过空格键、Tab键以及回车键打出的空格,都会被HTML(超文本标记语言)自动忽略。HTML将这样的键视为空白字符,并显示为单个空白间隔。尽管CSS提供了多种样式的空格和缩进,但是在HTML中也有一些工具可以让你自己定义空格。</div>
</div><div class="dc">
<div class="dc_top"><a href=""><h3><span style="color: red">百度</span>一下,你就知道</h3></a></div>
<div class="dc_left">
<img src="baidu.jpg" alt="" height="90%" width="100%">
</div>
<div class="dc_right">通常情况下,我们用空格键来打出多个空格,而在编写代码时,通过空格键、Tab键以及回车键打出的空格,都会被HTML(超文本标记语言)自动忽略。HTML将这样的键视为空白字符,并显示为单个空白间隔。尽管CSS提供了多种样式的空格和缩进,但是在HTML中也有一些工具可以让你自己定义空格。</div>
</div>
</div>
<div class="d_right">
<div class="dr_top">附近房价开始你发送到</div>
<div class="dr_center">
<div>
<img src="u=357489844,4049484276&fm=26&gp=0.jpg" alt="" width="100%" height="30%">
<span><a href="">电风扇</a></span>
<p>时代峻峰黄寺</p>
<p>时代峻峰黄寺</p>
</div>
<div>
<img src="u=357489844,4049484276&fm=26&gp=0.jpg" alt="" width="100%" height="30%">
<span><a href="">电风扇</a></span>
<p>时代峻峰黄寺</p>
<p>时代峻峰黄寺</p>
</div>
<div>
<img src="u=357489844,4049484276&fm=26&gp=0.jpg" alt="" width="100%" height="30%">
<span><a href="">电风扇</a></span>
<p>时代峻峰黄寺</p>
<p>时代峻峰黄寺</p>
</div>
</div>
</div>
<div class="d_right">
<div class="dr_top">附近房价开始你发送到</div>
<div class="dr_center">
<div>
<img src="u=357489844,4049484276&fm=26&gp=0.jpg" alt="" width="100%" height="30%">
<span><a href="">电风扇</a></span>
<p>时代峻峰黄寺</p>
<p>时代峻峰黄寺</p>
</div>
<div>
<img src="u=357489844,4049484276&fm=26&gp=0.jpg" alt="" width="100%" height="30%">
<span><a href="">电风扇</a></span>
<p>时代峻峰黄寺</p>
<p>时代峻峰黄寺</p>
</div>
<div>
<img src="u=357489844,4049484276&fm=26&gp=0.jpg" alt="" width="100%" height="30%">
<span><a href="">电风扇</a></span>
<p>时代峻峰黄寺</p>
<p>时代峻峰黄寺</p>
</div>
</div>
</div>
<div class="d_right">
<div class="dr_top">附近房价开始你发送到</div>
<div class="dr_center">
<div>
<img src="u=357489844,4049484276&fm=26&gp=0.jpg" alt="" width="100%" height="30%">
<span><a href="">电风扇</a></span>
<p>时代峻峰黄寺</p>
<p>时代峻峰黄寺</p>
</div>
<div>
<img src="u=357489844,4049484276&fm=26&gp=0.jpg" alt="" width="100%" height="30%">
<span><a href="">电风扇</a></span>
<p>时代峻峰黄寺</p>
<p>时代峻峰黄寺</p>
</div>
<div>
<img src="u=357489844,4049484276&fm=26&gp=0.jpg" alt="" width="100%" height="30%">
<span><a href="">电风扇</a></span>
<p>时代峻峰黄寺</p>
<p>时代峻峰黄寺</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
运行结果: