asp.net - asp :DropDownList width, 填充父级

标签 asp.net css

我有一个这样的下拉列表:

<asp:panel runat="server" groupingtext="Some Text">
  <table>
    <tr>
      <td><asp:DropDownList runat="server" /></td>
    </tr>
  </table>
</asp:panel>

我希望下拉列表的宽度始终填满父项的区域,而不管其中包含的元素的大小。我该怎么做?

最佳答案

下拉列表呈现为 <select>在 html 中 那么如何使用CSS? 喜欢

<td><asp:DropDownList runat="server" CssClass="yourclasshere"/></td>

select.yourclasshere { width:100px }

关于asp.net - asp :DropDownList width, 填充父级,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16568963/

相关文章:

jquery - 带有 fancybox 的 Asp.net 照片库不显示下一个/上一个按钮

html - 以相反的顺序显示 div

html - 是否有免费工具可以将网页渲染为具有透明背景的 PNG?

javascript - 如何根据鼠标悬停在图像上的位置突出显示 gridview 行?

javascript - 5星评级系统

asp.net - 在 ASP.NET 页面中保存变量

c# - System.Web.HttpException 文件不存在 - 页面加载正常 (ASP.NET)

php - 从另一个站点运行的外部 PHP 可以访问在 ASP.net 托管站点上运行的 mysql 吗?

asp.net - MVC Razor : How to mix html helpers and text in same line?

javascript - jQuery 验证未验证 ckeditor 数据