http://jsfiddle.net/fdezluis96/JJ29E/3/不同高度父DIV
我正在做一個類似Twitter的吧,我希望它顯示如圖所示的jsfiddle一些通知。這是一個菜單欄(主頁,連接,朋友,帳戶)和一個登錄按鈕,並且所有對瀏覽器寬度都是動態的,所以我不能把它放到margin:auto;
。我想在第二個例子中顯示,但是使用第一個語法,因爲我不能使用表格。代碼:
.navigation{
padding:5px;
font-family: HelveticaNeue, Tahoma, Verdana;
color: #fff;
font-size:20px;
background: #333;
height:24px;
overflow:hidden;
}
.subnavigation{
border:1px solid #fff;
border-top-width:0px;
border-bottom-width:0px;
overflow: auto;
background: #666;
border-radius:5px;
border-top-right-radius:0px;
border-top-left-radius:0px;
}
table{
float:left;
}
和HTML:
<!--Example one, desired syntax, not working-->
<div class="navigation">A
<div class="subnavigation">B.</div>
A
</div>
<br />
<!--Example two, working but with tables, so its not viable-->
<table>
<td class="navigation">A</td>
</table>
<table>
<td class="navigation subnavigation">
Scroll content<br />
Lorem ipsum...LALALALA<br />
Just more stuff<br />
And more<br />
And a bit more...
</td>
</table>
<table>
<td class="navigation">A</td>
</table>
感謝;)
你又做了 – ShrekOverflow 2012-02-25 16:55:29
是的,我的意思是下拉效果,但我不能在我的網上實現它,http://live-pin.com/現場演示,請幫助。 – Luis 2012-02-25 17:33:41
爲什麼OH爲什麼在'.notify'上有'margin-top:-200px'? – 2012-02-25 19:58:05