RSS
热门关键字:  Linux  图形  项目管理  LAMP  java
当前位置 : 主页>开源技术>AJAX技术>列表

DIV CSS排版中自适应高度的解决方法

来源:中国开源社区 作者:sherman 时间:2007-09-18 点击:

这是div css布局中经常会碰到的基础问题,个人觉得采用背景图填充的方法,还是比较简单和切实可行的。最终效果 字串2

CSS: 字串5

	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;

		/*--背景填充,解决左右栏高度不一致--*/

		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;

	} 字串5 

如果你有兴趣的话也可看下这里,用JS控制自适应高度的一种解决方法,不用背景图。 字串8

最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册