[請益] 想請問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