[問題] 有關於 div 並排置中

看板Ajax作者 (煉月)時間12年前 (2011/12/06 19:31), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
我有五個DIV分別是 <body> <div id="LogoArea" class="Logo"></div> <div id="MenuBar" class="MenuBar"></div> <div id="SubMenu" class="SubMenu"></div> <div id="MainArea" class="MainArea"></div> <div id="footer" class="Footer"></div> </body> CSS 部分 div.Logo { margin: auto ; text-align: center; width: 1000px; height: 50px; background-color: #FF0000; } div.MenuBar { margin: auto ; text-align: center; width: 1000px; height: 30px; z-index: 8; text-align: center; background-color: #00FF00; } div.SubMenu { /*position: relative; left: 0px; top: 3px;*/ display:table-cell; margin: auto ; text-align: center; width: 200px; height: 540px; text-align: center; width: 1000px; height: 50px; background-color: #FF0000; } div.MenuBar { margin: auto ; text-align: center; width: 1000px; height: 30px; z-index: 8; text-align: center; background-color: #00FF00; } div.SubMenu { display:table-cell; margin: auto ; text-align: center; width: 200px; height: 540px; z-index: 1; background-color: #FF0000; /*#f0f0f0*/ } div.MainArea { display:table-cell; margin: auto ; text-align: center; width: 800px; height: 540px; z-index: 1; background-color: #00FF00; } div.Footer { position: relative; clear: right; width: 1000px; height: 30px; background-color: #000000; } 為了要讓 SubMenu 和 MainArea 並列 所以使用display:table-cell; 卻一直無法置中.... -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 111.250.36.107

12/07 16:11, , 1F
多用一個DIV把SubMenu 和 MainArea包起來!
12/07 16:11, 1F
文章代碼(AID): #1EtVpzxK (Ajax)