第一种方法
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style>
div{
width:200px;
height:200px;
background:red;}
#div1{
display:inline-block;
}
#div2{
display:inline-block;
}
#div3{
display:inline-block;
}
</style>
</head>
<body>
<div id="div1">div1</div>
<div id="div2">div2</div>
<div id="div3">div3</div>
</body>
</html>
第二种方法
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style>
div{
width:200px;
height:200px;
background:red;
float:left}
</style>
</head>
<body>
<div id="div1">div1</div>
<div id="div2">div2</div>
<div id="div3">div3</div>
</body>
</html>
第三种方法
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style>
div{
width:200px;
height:200px;
background:red;
}
#div1{
display:inline-block;
}
#div2{
position:relative;
left:200px;
bottom:200px;
}
#div3{
position:relative;
left:400px;
bottom:400px;
}
</style>
</head>
<body>
<div id="div1">div1</div>
<div id="div2">div2</div>
<div id="div3">div3</div>
</body>
</html>
第二题
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style>
#box{
width:226px;
padding:0 20px 11px;
}
#div1{
width:18px;
height:19px;
border:1px #000 solid;
border-bottom:none;
font-size:12px;
display:inline-block;
}
#div2{
display:inline-block;
font-size:20px;
line-height:60px;
}
#div3{
margin-left:2px;
width:110px;
height:31px;
border:#ccc 1px solid;
border-bottom:none;
text-align:center;
line-height:30px;
}
#div4{
width:110px;
height:31px;
border-bottom:#ccc 1px solid;
position:relative;
left:113px;
top:-31px;
text-align:center;
color:#ccc;
line-height:30px;
}
#div6{
width:226px;
height:160px;
background-image:url(1452663224623.jpg);
margin-bottom:20px;
}
#div7{
width:20px;
height:26px;
z-index:1;
text-align:center;
background:#e2291c;
position:relative;
top:134px;
float:left
}
#div5{
width:206px;
line-height:26px;
background:black;
position:relative;
top:134px;
opacity:0.5;
float:left;
color:#fff;
text-indent:1em;
font-size:12px;
}
.form{font-size:13px;
background:url(../Documents/233.png) no-repeat;
text-indent:2.5em;
margin-bottom:10px;
}
</style>
</head>
<body>
<div id="box">
<div id="div1">TOP</div>
<div id="div2">排行榜</div>
<div id="div3">最热排行</div>
<div id="div4">新课上线</div>
<div id="div6">
<div id="div7">1</div>
<div id="div5">张小龙:微信四大价值观</div>
</div>
<div id="div6">
<div id="div7">1</div>
<div id="div5">刘超:互联网时代需要什么样...</div>
</div>
<div id="div6">
<div id="div7">1</div>
<div id="div5">马化腾:腾讯将专注于做互联网</div>
</div>
<div id="div6">
<div id="div7">1</div>
<div id="div5">IT领袖峰会圆桌会谈:互联网下...</div>
</div>
<div id="div6">
<div id="div7">1</div>
<div id="div5">微信支付对实体商业的价值几何?</div>
</div>
<div class="form">张小龙:小程序正式发布,开...</div>
<div class="form">张小龙:小程序正式发布,开...</div>
<div class="form">张小龙:小程序正式发布,开...</div>
<div class="form">张小龙:小程序正式发布,开...</div>
<div class="form">张小龙:小程序正式发布,开...</div>
</div>
</body>
</html>
链接:http://pan.baidu.com/s/1hsQbJqk 密码:2sr3