【发布时间】:2012-01-24 11:41:32
【问题描述】:
html代码
<div id="page">
<div id="container2">
<div id="container1">
<div id="mainarea">
<?php include mainarea_constractor.php";?>
</div>
<div id="sidebar">
//content_of_sidebar_goes_here
</div>
</div>
</div>
</div>
CSS代码:
#page{
margin:auto;
width:990px;
padding:0 10px;
padding-top:5px;
padding-bottom:5px;
background: url(/template/img/main/containt_bg.png) center center repeat-y;
overflow: hidden;
}
#container2 {
clear:left;
float:left;
width:990px;
overflow:hidden;
}
#container1 {
float:left;
width:995px;
position:relative;
right:340px;
border-right:1px double #c1c0a8;
text-align:justify;
}
#mainarea {
float:left;
width:650px;
left:340px;
position:relative;
overflow:hidden;
padding-right:5px;
}
#sidebar {
float:left;
width:330px;
position:relative;
left:345px;
overflow:hidden;
}
问题是当我将 div 放入 mainarea 时,我无法设置边距或填充选项 例如:
<div id="mainarea">
<div style="margin-left:15px;" id="inner_div">
Content_for_inner_div
</div>
</div>
有什么帮助吗? 当我将浮点数设置为#inner_div 有效时,但我不想浮点数进入我的 div ...... 如果可能,我不想更改我的通用模板 (page,container2,container1)
【问题讨论】:
-
我没发现问题:jsfiddle.net/GahtA
-
@ptriek 所以问题就在这里jsfiddle.net/GahtA/1 .lesson_more 内容 - 提示:点击标题
-
@user726730 冒着被贴上喜剧演员标签的风险,这对我来说都是希腊语。你到底遇到了什么问题?
-
我希望在课程更多课程中留有余量 ---