PTT
Submit
Submit
選擇語言
正體中文
简体中文
PTT
Web_Design
[問題] 巢狀DIV上下間距的問題該如何解決呢?
作者:
cat99961
(阿湯)
2014-09-02 23:14:41
請問以下內容,DIV TOP和DIV LEFT,DIV RIGHT,之間有一個空白間距
該如何解決呢?
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
.box2 {display:inline-block;}
div * {margin: 0;}
</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>
拜託各位高手了....
作者:
vi000246
(Vi)
2014-09-03 00:04:00
在top跟left的style裡加上float:left
作者:
iamnodoubt
(Have Fun)
2014-09-03 00:52:00
" target="_blank" rel="nofollow">
那是inline-block的特性
作者:
aspdoctor
(大崎)
2014-09-03 17:01:00
inline-block的空白要用letter-spacing跟word-spacing來解
作者:
cat99961
(阿湯)
2014-09-03 20:27:00
抱歉 那個網頁我有點看不懂我在inline-block後面加上letter-spacing:-5px;word-spacing:-5px;結果沒辦法解決ㄝ
作者:
eight0
(欸XD)
2014-09-03 21:59:00
簡單的說,把 </div> ... <div> 之間的空白、換行刪掉
作者: sycc (100倍返しだ!)
2014-09-04 03:51:00
樓上是最簡單的方法,如果你不是排版控的話XD
作者:
cat99961
(阿湯)
2014-09-04 16:01:00
我弄出來了 我把上下的外距設為負值
作者:
yshlptt
(小y)
2014-09-05 11:26:00
應該不用設定負值喔,設定 vertical-align: top 即可
繼續閱讀
Fw: [問題] 關於CloudFlare
Ansaga
[問題] FB api "應用程式設置..."
TarocciKa
Re: [問題] Hover的觸發條件
dv2001
[問題] wordpress改完網址找不到資料
oj113068
[問題] 把VPS上的wordpress網站導入本機xampp
yanggh
[問題] wordpress相關文章外掛YARPP縮圖設定
lin96108183
[問題] position:fixed 超出頁面就消失
gpgpt
[問題] PTT aid to URL
oToToT
Fw: [問題] 產生圖片 色碼問題
g66932007
[請益] div的入門教學書或網站
xFANx
Links
booklink
Contact Us: admin [ a t ] ucptt.com