作者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/m.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