ASP.Net 面板中控件的垂直对齐
我有一个包含以下内容的面板:
<asp:Panel ID="Panel1" runat="server" Height="101px">
Day
<asp:DropDownList ID="DropDownList1" runat="server" Height="24px" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
</asp:DropDownList>
Hour
<asp:DropDownList ID="DropDownList2" runat="server">
</asp:DropDownList>
</asp:Panel>
文本(“日”和“小时”)似乎相对于下拉框有不同的垂直对齐
替代文本 http://img215.imageshack.us/img215/115/paneld.jpg
如何轻松解决此问题?
I have a Panel with the following:
<asp:Panel ID="Panel1" runat="server" Height="101px">
Day
<asp:DropDownList ID="DropDownList1" runat="server" Height="24px" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
</asp:DropDownList>
Hour
<asp:DropDownList ID="DropDownList2" runat="server">
</asp:DropDownList>
</asp:Panel>
The texts ("Day" and "Hour") seem to have a different vertical alignment with respect to the dropdownboxes
alt text http://img215.imageshack.us/img215/115/paneld.jpg
How do I fix this easily?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
我偶然发现的一个解决方案是将文本和 DropDownLists 包含在一个带有单行的表格中,并为每个文本/Dropbox 提供一个单独的单元格。就像魅力一样。
One solution I stumbled on to was to enclose the text and DropDownLists in a Table with a single row and have a separate cell for each text/dropbox. Works like a charm.
这真的很简单:
It's really this simple:
不确定你是否尝试过这个...
Not sure you tried this or not...
您是否尝试过使用 style 属性调整垂直对齐方式?
http://www.w3schools.com/Css/pr_pos_vertical-align.asp
Have you tried adjusting the vertical alignment using the style attribute?
http://www.w3schools.com/Css/pr_pos_vertical-align.asp
尝试将标签形成为或在标签周围添加一些空格。它可能正在缠绕。
Try forming your tags as or add some whitespace around them. It may be wrapping.
如果你还没有尝试这个
try this if you haven"t
另一个答案有格式问题。又来了。
不确定你是否尝试过:
That other answer had formatting issues. Here is it again.
Not sure you tried it or not: