Asp.net
為什麼單選按鈕列表總是佔據一個新行?
這是一個關於佈局的問題。我正在開發一個 .net 頁面,每當我在標籤之後添加一個單選按鈕列表時,它都會歸結為下一行。但是在程式碼方面,它仍然在同一行內。問題是,如果您在 IE 中瀏覽它,它會歸結為下一行。我確信標籤和單選按鈕列表的寬度都沒有過大。是什麼原因以及如何解決這個問題?提前致謝。
RadioButtonList 預設呈現為表格。您可以更改設置屬性RepeatLayout=“Flow”,它將在跨度中呈現。
將屬性添加到您的單選按鈕列表
重複方向=“水平”
<asp:RadioButtonList RepeatDirection="Horizontal" ID="RadioButtonList1" runat="server" style="display:inline"> <asp:ListItem>asdf</asp:ListItem> <asp:ListItem>sdfg</asp:ListItem> </asp:RadioButtonList>這將解決您的問題。乾杯