找回密码
 注册
搜索
热搜: 回贴

CSS布局中自适应高度的解决方法

2009-12-16 23:45| 发布者: admin| 查看: 72| 评论: 0|原作者: 九天玄女

  这是div+css布局中经常会碰到的基础问题,个人觉得采用背景图填充的方法,还是比较简单和切实可行的。最终效果。
  CSS源代码:
  body{
  background: #EDEDED;
  font-size: 70%;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 130%;
  color: #666666;
  margin: 0;
  padding: 0;
  text-align: center;
  }
  #layout{
  width: 760px;/*--for ie5.x--*/
  w\idth: 740px;/*--other--*/
  margin: 10px auto;
  border: solid 10px #999999;
  border-bottom: solid 9px #999999;
  /*--底部要加个1px的DIV来清除浮动,所以把
  底边框设为9px--*/
  background: url(bg.gif) #FFFFFF repeat-y left;
情缘.教程_网 [http://Www.XiuGoo.Com]
  /*--背景填充,解决左右栏高度不一致--*/
  text-align: left;
  }
  #sidel{
  float: left;
  width: 190px;
  }
  #sider{
  float: right;
  width: 540px;
  }
  pre{
  padding: 10px;
  margin: 0;
  }
  .clear{
  background: #999999;
  clear: both;
  height: 1px;
  overflow: hidden;
  }

最新评论

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-29 19:20 , Processed in 0.204145 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

返回顶部