css作业练手用
sohu.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" />
<link rel="stylesheet" type="text/css" href="my.css" />
<title>无标题文档</title>
</head>
<body>
<!--top部分-->
<div class="top">
<span class="login">登录表单</span>
<span class="setindex">设置首页面</span>
<span class="myhref">超链接</span>
</div>
<!--logo-->
<div class="logo">
</div>
<!--导航-->
<div class="navi">
</div>
<!--广告-->
<div class="adAll">
<div class="adstu">
招生广告</div>
<div class="adSport">
运动广告</div>
<div class="adfdc">
房地产广告
</div>
<div class="adimg">
图片广告
</div>
</div>
</body>
</html>
my.css
/* CSS Document */
body{
margin:0 auto;
/*border:1px solid green;*/
width:950px;
height:800px;
font-size:12px;
}
.top{
width:950px;
/*background:silver;*/
height:24px;
}
.login{
width:350px;
height:22px;
background:pink;
float:left;
}
.setindex{
width:85px;
height:22px;
background:green;
float:left;
margin-left:100px;
}
.myhref{
float:right;
margin-right:5px;
margin-top:3px;
}
/*我的logo*/
.logo{
width:130px;
height:56px;
background:silver;
float:left;
margin-top:3px;
}
/*导航*/
.navi{
width:805px;
height:56px;
background:#7BF773;
float:left;
margin:3px;
margin-right:10px;
}
/*总体广告div*/
.adAll{
width:950px;
height:211px;
border:1px solid sliver;
margin-top:3px;
float:left;
}
/*招生广告*/
.adstu{
width:126px;
height:195px;
background:#7BF773;
border:1px solid silver;
margin-top:3px;
float:left;
}
/*运动广告*/
.adSport{
width:451px;
height:195px;
background:#7BF773;;
float:left;
margin:5px 0 0 15px;
}
/*房地产广告*/
.adfdc{
width:151px;
height:195px;
background:#7BF773;;
float:left;
margin:5px 0 0 15px;
}
/*图片广告*/
.adimg{
width:180px;
height:211px;
background:pink;
float:right;
text-align:center;
border-left:1px solid silver;
}