给个方法:
  for (int i = 0; i < DropDownList1.Items.Count; i++)
                {
                    if (i % 2 == 0)
                    {
                        DropDownList1.Items[i].Attributes.Add("style","BACKGROUND-COLOR:#008888");
                    }
                }

解决方案 »

  1.   

    哪里不行,你看看.
    另外,楼主说的WEB控件是HTML控件吧?!好象规范的说法是"HTML控件"吧,有没有看到这个System.Web.UI.HtmlControls;
            <select>
                <option style="COLOR: #ff0000" value="red"> 红色 </option>
                <option style="COLOR: #ffa500" value="orager"> 橙色 </option>
                <option style="COLOR: #ffff00" value="yellow"> 黄色 </option>
                <option style="COLOR: #008000" value="green"> 绿色 </option>
                <option style="COLOR: #32cd32" value="cyan"> 青色 </option>
                <option style="COLOR: #0000ff" value="blue"> 蓝色 </option>
                <option style="COLOR: #800080" value="purple"> 紫色 </option>
            </select>    
      

  2.   

    一样没有问题,我不知道你的代码是错了还是发贴时格式被打乱,你COPY我的试试
    <asp:DropDownList   class="smallselect"   onchange="   return   setColor();" id="DropDownList2" runat="server">
        <asp:ListItem   style="COLOR:   #ff0000"   value="red"   selected> 红色 </asp:ListItem>
        <asp:ListItem   style="COLOR:   #ffa500"   value="orager"> 橙色 </asp:ListItem>
        <asp:ListItem   style="COLOR:   #ffff00"   value="yellow"> 黄色 </asp:ListItem>
        <asp:ListItem   style="COLOR:   #008000"   value="green"> 绿色 </asp:ListItem>
        <asp:ListItem   style="COLOR:   #32cd32"   value="cyan"> 青色 </asp:ListItem>
        <asp:ListItem   style="COLOR:   #0000ff"   value="blue"> 蓝色 </asp:ListItem>
        <asp:ListItem   style="COLOR:   #800080"   value="purple"> 紫色 </asp:ListItem>
    </asp:DropDownList> 
      

  3.   

    <%@ Page language="c#" Codebehind="chat_input.aspx.cs" AutoEventWireup="false" Inherits="OA_Office.table_index.files.chat.chat_input" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
       <HEAD>
         <TITLE></TITLE>
            <LINK href="style.css" type="text/css" rel="stylesheet">
            <META content="C#" name="CODE_LANGUAGE">
    <META content="JavaScript" name="vs_defaultClientScript">
    <META content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
    <META http-equiv="Content-Type" content="text/html; charset=gb2312">
    <META content="MSHTML 6.00.2900.3199" name="GENERATOR">
       </HEAD>
    <BODY class="bodycolor" leftMargin="0" topMargin="0" rightMargin="0">
       <FORM id="Form1" name="Form1" method="post" runat="server">
         <SCRIPT src="images/prototype.ashx" type="text/javascript"></SCRIPT>
         <SCRIPT src="images/core.ashx" type="text/javascript"></SCRIPT>
         <SCRIPT src="images/converter.ashx" type="text/javascript"></SCRIPT>
         <SCRIPTsrc="images/AnyOffice.general.netmeeting.attend.AjaxMethods,
                   AnyOffice.ashx"type="text/javascript"></SCRIPT>
         <TABLE class="small" cellSpacing="1" cellPadding="3" width="101%" bgColor="#000000" border="0">
         <TBODY>
    <TR class="TableHeader">
       <TD><SPAN>对象
          <asp:DropDownList class="SmallSelect" id="DropDownList1" runat="server"></asp:DropDownList>
    悄悄话
         <INPUT id="IsPrivate" type="checkbox" value="checkbox" name="IsPrivate">
             字色
         <asp:DropDownList class="smallselect" onchange=" return setColor();" id="DropDownList2" runat="server">
         <asp:ListItem style="COLOR: #ff0000" value="red" selected>红色</asp:ListItem>
         <asp:ListItem style="COLOR: #ffa500" value="orager">橙色</asp:ListItem>
         <asp:ListItem style="COLOR: #ffff00" value="yellow">黄色</asp:ListItem>
         <asp:ListItem style="COLOR: #008000" value="green">绿色</asp:ListItem>
         <asp:ListItem style="COLOR: #32cd32" value="cyan">青色</asp:ListItem>
         <asp:ListItem style="COLOR: #0000ff" value="blue">蓝色</asp:ListItem>
         <asp:ListItem style="COLOR: #800080" value="purple">紫色</asp:ListItem>
         </asp:DropDownList>
        <SCRIPT>
          var messageColor='red';  function setColor()
       {
       var selectColor = document.getElementById('selectColor');
       messageColor=selectColor.value;
       }
         </SCRIPT>
    就是这里 请大家在看看有没有外面把里面的颜色覆盖的地方
    自动滚动<INPUT id="chScroll" type="checkbox" CHECKED name="chScroll"> </SPAN>
    </TD>
    </TR>
    <TR class="TableHeader">
    <TD height="30">
    <asp:TextBox class="SmallInput" id="TextBox1" runat="server" MaxLength="100" Width="500px"></asp:TextBox>
    <asp:Button class="SmallButton" id="Button1" runat="server" Text="发言"></asp:Button>
    </TD>
    </TR>
    </TBODY>
    </TABLE>
    <SCRIPT language="javascript">
    //回车键发送消息
    function clickButton(e, buttonid)

    var bt = document.getElementById(buttonid); 
    if (typeof bt == 'object')

    if(navigator.appName.indexOf("Netscape")>(-1)){ 
    if (e.keyCode == 13)

    bt.click(); 
    return false; 


    if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1))

    if (event.keyCode == 13)

    bt.click(); 
    return false; 


    }  
    } function GetUsers()
    {
    if(timer_user!=null)
    window.clearTimeout(timer_user);

    AnyOffice.general.netmeeting.attend.AjaxMethods.GetOnline(1,CallBack_GetUsers);
    timer_user=setTimeout("GetUsers()",30000);
    }function SayTo(userId)
    {
    var oSelect = document.getElementById("selectOnlineUsers");
    for(var i=0;i<oSelect.length;i++)
    {
    if(oSelect.options[i].value == userId)
    {
    oSelect.options[i].selected = true;
    }
    }}function CallBack_GetUsers(res)
    {
    if(res != null && res.value != null && res.value.Tables != 0 && res.value.Tables.length == 1)
    {
    var selectValue="";
    var usersList="";
    var onlineNums=0;
    var opt;
    var oSelect = document.getElementById("selectOnlineUsers");
    selectValue = oSelect.value;

    // clear dropdownlist
    for(var i=oSelect.length-1; i>0; i--)
    {
    oSelect.options[i] = null;
    }

    for(var i=0; i<res.value.Tables[0].Rows.length; i++)
    {
    usersList += "<a href=\"javascript:parent.chat_input.SayTo('" + res.value.Tables[0].Rows[i].UserId + "');\">" + res.value.Tables[0].Rows[i].NickName + "</a><br>"
    opt = new Option(res.value.Tables[0].Rows[i].NickName, res.value.Tables[0].Rows[i].UserId);
    oSelect.options[oSelect.length] = opt;
    onlineNums +=1;
    }

    var oOnlineNums = parent.chat_user.document.getElementById("onlineNums")
    if(oOnlineNums != null)
    oOnlineNums.innerHTML = "在线人员" + onlineNums + "人";

    var onlineUsersList = parent.chat_user.document.getElementById("onlineUsersList")
    if(onlineUsersList != null)
    onlineUsersList.innerHTML = usersList;


    for(var i=0;i<oSelect.length;i++)
    {
    if(oSelect.options[i].value == selectValue)
    {
    oSelect.options[i].selected = true;
    }
    }

    }
    }function SendMessage()
    {
    var color = messageColor;
    var content = document.getElementById('txtMsg').value;
    if(content == "")
    return;
    var oSelect = document.getElementById("selectOnlineUsers");
    var toId = oSelect.value;

    var isPrivate = document.all.IsPrivate.checked; //输入框清空
    document.getElementById('txtMsg').value=''; AnyOffice.general.netmeeting.attend.AjaxMethods.SendMessage(1, toId, color, isPrivate, content);
    }GetMessage();
    GetUsers(); </SCRIPT>
    </FORM>
    </BODY>
    </HTML>
      

  4.   

    我将你在11楼贴出的代码COPY到网页,很郑重的告诉你,效果跟我期望的一样,下列列表项字体颜色跟设置的一样,red,blue,black,cyan.....
    我想,你新建一个网页试试看。
    另外,你既已声明<!DOCTYPE   HTML   PUBLIC   "-//W3C//DTD   HTML   4.0   Transitional//EN">,最就按这个标准,尽量不要在HTML里出现不规范的字符,如大小写,属性等。