我的布局如下: <div id="box">
<div id="left">
<div id="left1"> </div>
<div id="left2"> </div>
</div>
<div id="main"> </div>
<div id="bottom"> </div>
</div>
但是如果main或者left2的内容超长~就会跟下面的bottom层重叠了~就是说没有自动撑大~而是直接穿过去了~~应该怎么解决哦??CSS如下:body {
}#box {
width:926px;
margin:0 auto;
}
#box #left
{
margin-top:5px;
float: left;
width: 125px;
height:200px; }
*html #box #left1 {
float: left;
width: 125px;
height:200px; }
*+html #box #left1 {
float: left;
width: 125px;
height:200px; } #box #main {
float: left;
width: 500px;
height: 500px;
}
*html #box #main
{float: left;
margin : 5px auto auto 5px ;
width: 450px;
height: 500px;
}
*+html #box #main {
float:left;
margin : 5px auto auto 75px ;
width: 450px;
height: 500px;
}
#box #bottom {
clear: both;
}
*#box #bottom
{}
*+html #box #bottom
{
clear:left;
} 各位大大`这个问题弄了几天了`网上资料也没有`那个郁闷呢`100分悬赏啊!!!555555555
<div id="left">
<div id="left1"> </div>
<div id="left2"> </div>
</div>
<div id="main"> </div>
<div id="bottom"> </div>
</div>
但是如果main或者left2的内容超长~就会跟下面的bottom层重叠了~就是说没有自动撑大~而是直接穿过去了~~应该怎么解决哦??CSS如下:body {
}#box {
width:926px;
margin:0 auto;
}
#box #left
{
margin-top:5px;
float: left;
width: 125px;
height:200px; }
*html #box #left1 {
float: left;
width: 125px;
height:200px; }
*+html #box #left1 {
float: left;
width: 125px;
height:200px; } #box #main {
float: left;
width: 500px;
height: 500px;
}
*html #box #main
{float: left;
margin : 5px auto auto 5px ;
width: 450px;
height: 500px;
}
*+html #box #main {
float:left;
margin : 5px auto auto 75px ;
width: 450px;
height: 500px;
}
#box #bottom {
clear: both;
}
*#box #bottom
{}
*+html #box #bottom
{
clear:left;
} 各位大大`这个问题弄了几天了`网上资料也没有`那个郁闷呢`100分悬赏啊!!!555555555
解决方案 »
- (难到很多高手的问题)用VS调试成功,但把项目用IIS打开就不成功???????何解???
- 请教一个关于Forms身份验证后,不能通过Cookie保持身份验证的问题
- 新手求助!!!页面间传值问题~
- 用DataSource控件和直接赋值DataTable给控件的DataSource属性有什么差别?
- 紧急救助一下:gridview 的这种排序如何实现?
- 网页中出现乱码
- CSS制作菜单下 链接直接点击如何获得用户控件中参数来切换语言?
- 求:处理非法字符的函数
- 关于网站布局的问题,在线,急!!!!!!!!!!!!!!
- OleDbType.VarChar和OleDbType.VarWChar有什么区别?
- 上分咯!简单问题 如何在字符串中补空格 补0 解决速度上分!
- DropDownList文章检索的问题
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>未命名頁面</title>
<style type="text/css">
body {
} #box {
width:926px;
margin:0 auto;
}
#box #left
{
margin-top:5px;
float: left;
width: 125px;
height:200px; }
*html #box #left1 {
float: left;
width: 125px;
height:200px; }
*+html #box #left1 {
float: left;
width: 125px;
height:200px; } #box #main {
float: left;
width: 500px;
height: 500px;
}
*html #box #main
{ float: left;
margin : 5px auto auto 5px ;
width: 450px;
height: 500px;
}
*+html #box #main {
float:left;
margin : 5px auto auto 75px ;
width: 450px;
height: 500px;
}
#box #bottom {
clear: both;
width: 450px;
height: 50px;
margin-left:10px;
} *+html #box #bottom
{
clear:left;
}
#right
{
float:left;
}
</style>
</head>
<body >
<form id="form1" runat="server"> <div id="box">
<div id="left">
<div id="left1"> </div>
<div id="left2"> </div>
</div>
<div id="right">
<div id="main"> </div>
<div id="bottom"> </div>
</div>
</div> </form>
</body>
</html>
如果是绝对的话,那相互间就不会受内容长度的影响,可能会重叠
给你一个代码。放到一个文件里。以后每个css文件都调用它body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td { padding:0px; margin: 0px;}
table {border-collapse: collapse;border-spacing: 0;}
fieldset,img { border: 0;}
address,caption,cite,code,dfn,em,strong,th,var {
font-weight: normal;
font-style: normal;
}
div{position :relative;}
ol,ul {list-style: none; margin :2px;}
caption,th {text-align: left;}
h1,h2,h3,h4,h5,h6 {font-weight: normal;font-size: 100%;}
q:before,q:after {content:'';}
abbr,acronym { border: 0;}
span{ padding :2px;}