[请益] 想请问DIV巢状排版的问题

楼主: cat99961 (阿汤)   2014-09-02 22:48:05
不好意思,我知道这里不是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
作者: swallowcc (guest)   2014-09-02 22:57:00
WEB_DESIGN应该比较适合
楼主: cat99961 (阿汤)   2014-09-02 23:15:00
谢谢你提供的资讯 ^^
作者: oread168 (大地的精靈R)   2014-09-03 16:26:00
设margin-top:0行吗(? .....瞎猜 脱离这块很久了刚才左试右试 结果把 !DOCTYPE填完整好像就没问题囉

Links booklink

Contact Us: admin [ a t ] ucptt.com