0

我使用 ASP:DropDownList 控件在 ASP.net 页面上选择了文本框和下拉列表。

它们在 chrome、IE、opera、safari 中都显示良好,但在 FF 中我得到:

在此处输入图像描述

注意“请选择”在下拉列表中对齐顶部。

代码:

<asp:DropDownList runat="server" onclick="changeBorderColor(this.id)" forecolor="White"  style="border:none; Width:352px; font-size:15px; font-family:Arial, helvetica, Verdana; height:35px; color: rgb(0, 0, 0); border: 1px solid rgb(124, 201, 25); border-radius:4px 4px 4px 4px; box-shadow:0px 0px 9px rgb(191, 191, 191) inset; padding-left:10px; " ID="Country" Width="282px" >

我尝试过一些“填充顶部:”但它会导致其他问题。

如何让文本显示在控件的垂直中心?

4

2 回答 2

1

我曾经提出的最好的解决方案是给予padding-toppadding-bottom。假设现在你有font-size: 15px;and height: 35px;,所以这意味着20px备用,所以添加padding-top: 10pxandpadding-bottom: 10px和文本应该垂直居中在你的input.

于 2013-01-11T15:54:28.327 回答
1

而不是vertical-align使用line-height30 或其他东西。尝试20到30之间的东西

于 2013-01-11T15:49:22.693 回答