div+css简单作品

div+css简单布局代码如下:

其中遇到了一点问题 希望高手能点拨一下。

灰色的模块right_main我想漂浮到右边但是 代码写完了 却不能实现 高手告诉我一下这是为什么?  谢谢了

 

<html>
<head>
 <title>网页布局</title>
<style>
<!--
 body{
  margin:0px;
  text-align:center;
  background:grey;
 }
 #container{
  width:500px;
  height:700px;
  background:#fe7856;
  margin:auto 0px;
 }
 #header{
  float:left;
  width:800px;
  height:100px;
  margin:auto 0px;
  clear:both;
  background:red;
 }
 #logo{
  float:left;
  width:250px;
  height:90px;
  background:green;
  clear:right;
  margin:0px;
 }
 #banner{
  float:right;
  width:540px;
  height:90px;
  margin:0px;
  clear:left;
  background:#ff11f2;
 }
 #menu{
  width:800px;
  height:35px;
  margin:auto 0px;
  clear:both;
  background:#4460ff
 }
 .nav{
  width:800px;
  height:10px;
  clear:both;
  background:white;
  line-height:10px;
 }
 .left_main{
  float:left;
  width:610px;
  height:410px;
  background:red;
  clear:right;
  margin:0px;
 }
 .right_main{
  float:right;
  width:180px;
  height:410px;
  margin:0px;
  clear:left;
  background:#aabbcc;
 }
 .left_a{
  margin:0px;
  float:left;
  width:300px;
  height:200px;
  background:blue;
 }
 .left_b{
  margin:0px;
  float:right;
  width:300px;
  height:200px;
  background:blue;
 }
 .nav_a{
  width:610px;
  height:10px;
  clear:both;
  background:white;
  line-height:10px;
 }
 .con {
  margin:auto 0px;
   width:800px;
   height:200px;
  background:green;
  clear:both; 
 
 }
 .one{
  margin:5px;
  clear:right;
  float:left;
  width:190px;
  height:240px;
  background:#ccffaa;
 }
 .two{
  margin:5px;
  float:left;
  width:190px;
  height:240px;
  background:#cddfaa;

 }
 #footer {
  width:800px;
  height:100px;
  background:red;
  margin:auto 0px;
  padding-top: 30px;
  color: #ffffff;
 }
//-->

</style>

 

</head>


<body>
<div id="container">
 <div id="header">
  <div id="logo">
  logo
  </div>
  <div id="banner">
  banner
  </div>
 </div>
 <div id="menu">
 main
 </div>
 <div class="nav">
 nav
 </div>
 <div class="left_main">
  <div class="left_a">
  </div>
  <div class="left_b">
  </div>
  <div class="nav_a">
  nav
  </div>
  <div class="left_a">
  </div>
  <div class="left_b">
  </div>
 </div>
 <div class="right_main">
 </div>
 <div class="nav">
 nav
 </div>
 <div class="con">
  <div class="one"></div>

  <div class="two"></div>

  <div class="one"></div>

  <div class="two"></div>
 </div>
 <div id="footer">
 footer
 </div>

</div>

</body>

</html>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值