第一張圖片沒有溢出。頂部是我按下按鈕之前,底部是之後。
alt text http://img19.imageshack.us/img19/7594/nooverflow.png
並將該圖像與overflow:auto
。頂部是我按下按鈕之前,底部是之後。
alt text http://img134.imageshack.us/img134/4015/overflow.png
什麼我要找的是面板看起來像它的第一個圖像之前,我按下按鈕,它是什麼樣子的第2圖像中,當我做按按鈕。
下面是相關的代碼的副本:
<asp:Panel ID="pnlCustomer" runat="server" style="background-color:#ccccff; width:500px; height:90%; position:relative;" BorderColor="DarkBlue" BorderWidth="2px">
...
<style>
div.textboxArea {
text-align:center;
float:left;
width:40%;
margin-top:35px;
}
.textboxArea TextBox {
width:80%;
}
.centerMeVertically div {
position:absolute;
top:50%;
vertical-align:middle;
height:30px;
width:100%;
margin-top:0px;
text-align:center;
}
div.centerMeVertically {
float:left;
width:20%;
text-align:center;
height:60px;
position:relative;
}
p {
margin:-35px 0 0 0;
}
.container {
margin-top:10px;
margin-bottom:10px;
overflow:auto;
}
</style>
<div class="container">
<div style="width:100%;">
<div class="textboxArea">
<p><asp:Label runat="server" ID="lblInfoDesc" /></p>
<asp:TextBox ID="txtInfoDescription" runat="server" TextMode="MultiLine" Rows="3" MaxLength="500" />
</div>
<div class="centerMeVertically">
<div><asp:Button ID="btnNextInfo" runat="server" Text="Next" /></div>
</div>
<div class="textboxArea">
<p><asp:Label runat="server" ID="lblInfoData" /></p>
<asp:TextBox ID="txtInfoData" runat="server" TextMode="MultiLine" Rows="3" MaxLength="500" />
</div>
</div>
</div>
爲什麼絕對定位首選顯示:無?顯示:沒有任何東西肯定是我隱藏東西的首選方式,比將東西推出屏幕更有意義。 – Sekhat 2009-12-18 15:50:51
實際上,TextBoxes隱藏在後面的代碼(VB)中,如txtInfoData.Visible = false;我將如何使用顯示器:無按鈕單擊並將其切換到另一按鈕單擊? – Justen 2009-12-18 15:55:54
@Sekhat定位屏幕外的東西往往是更好的可訪問性和搜索引擎優化的目的。 – 2009-12-18 15:57:57