.NET DROPDOWNLIST对齐文本 [英] .net dropdownlist align text

查看:255
本文介绍了.NET DROPDOWNLIST对齐文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

  1. 是这样吗?

我使用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浏览器失败的选项元素,传递选择元素
 

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.

  1. 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

这篇关于.NET DROPDOWNLIST对齐文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆