作者cat99961 (阿汤)
看板PHP
标题[请益] 想请问DIV巢状排版的问题
时间Tue Sep 2 22:48:05 2014
不好意思,我知道这里不是CSS的版
但是PTT内好像没有CSS的版
所以我在此发问
我想要问的是DIV top和下方的left及right有一个白色间距,请问如何解决呢?
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
.box2 {display:inline-block;
</style>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body style="padding:0;;margin:0;">
<div id="wrapper" style="width:600px;margin: 0 auto;height: 900px;
border-width: 1px; border-color: #8f8f8f; border-style: solid;">
<div class="box2" id="top" style="width: 600px;height: 100px;
background: red;"></div>
<div class="box2" id="left" style="width:100px;height: 700px;
background: green;"></div>
<div class="box2" id="right" style="width:500px;height: 700px;
background:gold;"></div>
<div id="footer" style="width: 600px;height: 100px;background:red;">
footer</div>
</div>
</body>
</html>
其实我有用FLOAT,做出来没有间距的,但是我被要求
还要用display:inline-block
做一个,所以我只好在这里发问,拜托你们了X
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 118.232.166.94
※ 文章网址: http://webptt.com/cn.aspx?n=bbs/PHP/M.1409669288.A.B8A.html
1F:推 swallowcc: WEB_DESIGN应该比较适合 09/02 22:57
2F:→ cat99961: 谢谢你提供的资讯 ^^ 09/02 23:15
3F:→ oread168: 设margin-top:0行吗(? .....瞎猜 脱离这块很久了 09/03 16:26
4F:推 oread168: 刚才左试右试 结果把 !DOCTYPE填完整好像就没问题罗 09/03 21:12