.NET DROPDOWNLIST对齐文本文本、NET、DROPDOWNLIST

2023-09-11 07:55:56 作者:谎言丶縂是那么的动听ゝ

我想对齐文本在我的.NET DropDownList的右侧。使用的CssClass我能够对齐文本的权利在Firefox。

IE不不对齐文本到它对齐向左右侧。 我已阅读,IE 6不支持这一点。

是这样吗?

我使用IE7,但我的大多数用户会在IE 6等等,都需要工作。

 < ASP:DropDownList的ID =ddlNominationWIDTH =250像素的CssClass =ddlnomination
    =服务器的DataSourceID =AzoaDataTextField =nomination_type
    DataValueField =nomination_type>
    < ASP:列表项> < / ASP:列表项>
< / ASP:DropDownList的>
 

CSS

  .ddlnomination
{
   文本对齐:右;
}
 

解决方案

设置它(的text-align =正确的)对IE6的选择或选项的元素, IE7和放大器; IE8(即使是在标准模式)不出现工作

测试后,一些快速统计

 浏览器|结果
 Firefox 3的通行证
 歌剧9.5通行证
 IE 6失败
 IE 7的失败
 IE 8失败
 Safari浏览器3失败
 Safari 4的失败
 Chrome浏览器失败的选项元素,传递选择元素
 
使用VB net ReadLine读取指定行文本的方法说明

I am trying to align the text in my .net dropdownlist to the right. Using CssClass I am able to align text to the right in Firefox.

IE doesn't not align text to the right it aligns to the left. I have read that IE 6 doesn't support this.

Is this true?

I am using IE7 but most of my users will be in IE 6 so, both need to work.

<asp:DropDownList ID="ddlNomination" Width="250px" CssClass="ddlnomination"
    runat="server" DataSourceID="Azoa" DataTextField="nomination_type" 
    DataValueField="nomination_type">
    <asp:ListItem> </asp:ListItem>
</asp:DropDownList>

css

.ddlnomination
{
   text-align:right;
}

解决方案

Setting it (text-align="right") on the Select or Option elements in IE6, IE7 & IE8 (even in standards mode) does not appear to work.

Some quick stats after testing.

Browser    |  Result
 Firefox 3     Passes
 Opera 9.5     Passes
 IE 6          Fails
 IE 7          Fails
 IE 8          Fails
 Safari 3      Fails
 Safari 4      Fails
 Chrome        Fails on the Option element, Passes on the Select element