[請益] 想請問DIV巢狀排版的問題

看板PHP作者 (阿湯)時間9年前 (2014/09/02 22:48), 編輯推噓2(202)
留言4則, 3人參與, 最新討論串1/1
不好意思,我知道這裡不是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://www.ptt.cc/bbs/PHP/M.1409669288.A.B8A.html

09/02 22:57, , 1F
WEB_DESIGN應該比較適合
09/02 22:57, 1F

09/02 23:15, , 2F
謝謝你提供的資訊 ^^
09/02 23:15, 2F

09/03 16:26, , 3F
設margin-top:0行嗎(? .....瞎猜 脫離這塊很久了
09/03 16:26, 3F

09/03 21:12, , 4F
剛才左試右試 結果把 !DOCTYPE填完整好像就沒問題囉
09/03 21:12, 4F
文章代碼(AID): #1K1TYekA (PHP)