
如图。HTML怎么把页面分成3部分?
分是分好了,可是那个边框。怎么让每个div之间不要紧贴在一起啊。上下左右都留点空白。我在这3个div最外面也有一层大的div.用了padding和margin都不行,我疯...
分是分好了,可是那个边框。怎么让每个div之间不要紧贴在一起啊。上下左右都留点空白。我在这3个div最外面也有一层大的div.用了padding和margin都不行,我疯了。。。。
展开
4个回答
展开全部
上面那两个div设置百分比宽度不要占满,
<section class="one">
<section class="two">
<section class="ss"></section>
<section class="three"></section>
</section>
<aside></aside>
</section>
<footer>footer</footer>
CSS
.one{
width:1240px;
height:340px;
margin:16px auto 16px;
}
.one .two{
width:702px;
height:320px;
background:#333;
float:left;
border-radius:5px;
border:10px solid #666;
}
.one .two .ss{
width:702px;
height:155px;
background:#333;
float:left;
border-radius:5px;
}
.one .two .three{
width:702px;
height:155px;
background:#333;
border-radius:5px;
border-top:10px solid #666;
float:left;
}
aside{
width:492px;
height:340px;
background:#666;
float:right;
border-radius:5px;
}
footer{
width:1240px;
height:60px;
background:#666;
border-radius:5px;
margin:0 auto 10px;
text-align: center;
line-height:60px;
color:white;
font-size:28px;
}
<section class="one">
<section class="two">
<section class="ss"></section>
<section class="three"></section>
</section>
<aside></aside>
</section>
<footer>footer</footer>
CSS
.one{
width:1240px;
height:340px;
margin:16px auto 16px;
}
.one .two{
width:702px;
height:320px;
background:#333;
float:left;
border-radius:5px;
border:10px solid #666;
}
.one .two .ss{
width:702px;
height:155px;
background:#333;
float:left;
border-radius:5px;
}
.one .two .three{
width:702px;
height:155px;
background:#333;
border-radius:5px;
border-top:10px solid #666;
float:left;
}
aside{
width:492px;
height:340px;
background:#666;
float:right;
border-radius:5px;
}
footer{
width:1240px;
height:60px;
background:#666;
border-radius:5px;
margin:0 auto 10px;
text-align: center;
line-height:60px;
color:white;
font-size:28px;
}
追问
没啊,还有那么大留白了。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
不要用浮动,用padding就可以
更多追问追答
追问
不设浮动,padding四个方向都设了值。结果div都是一行一行的了。还有那么留白 也并没有一行埃在一起
追答
可以这样布局:
div1 左浮动 div2 右浮动 再设置一个边距
最下面一个div
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
都别和我抢啊,都是it男,教你个最笨的方法,用一个dip在中间就隔开了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你可以用Bootstrap
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询