Asp.net 设置asp dropdownlist选择框的宽度

Asp.net 设置asp dropdownlist选择框的宽度,asp.net,drop-down-menu,Asp.net,Drop Down Menu,我以前也问过类似的问题(答案)。他们没有我需要的东西。我需要下拉列表的宽度始终保持不变。即使它落下&物品也比它的宽度宽。较宽的项目应显示为工具提示。你是怎么做到的?选择元素的处理是什么?为什么每个帖子都有“选择”的答案。我正在使用asp下拉列表。如何使用select?总之,以下是我的ddl CSS: .ddl2 { margin-top: 10px; margin-bottom: 10px; border-style: solid; border-width: thin; border-colo

我以前也问过类似的问题(答案)。他们没有我需要的东西。我需要下拉列表的宽度始终保持不变。即使它落下&物品也比它的宽度宽。较宽的项目应显示为工具提示。你是怎么做到的?选择元素的处理是什么?为什么每个帖子都有“选择”的答案。我正在使用asp下拉列表。如何使用select?总之,以下是我的ddl CSS:

.ddl2
{
margin-top: 10px;
margin-bottom: 10px;
border-style: solid;
border-width: thin;
border-color: Gray;
height: 20px;
max-width: 150px;
}
当未选择任何内容时,此选项有效(仅在firefox中)。一旦ddl下降,selectbox将获取最宽元素的宽度

编辑:

   try
        {

            DataSet dsCountry = objBindDDL.BindDropDownListToACountry();
            ddlCountry.DataSource = dsCountry.Tables["ACountry"];
            ddlCountry.DataTextField = "CountryName";
            ddlCountry.DataValueField = "ID";
            ddlCountry.DataBind();
            ddlCountry.Items.Insert(0, new ListItem("Please select Country", ""));
        }