我有报告的门户网站。每个报告都有固定宽度= 130px的下拉列表。一切都很好,但是当我尝试最小化窗口时,页面上没有显示某些元素。我的代码正在关注
<tr valign="bottom" style="height: 10px">
<td width="20px" style="vertical-align: top">
</td>
<td width="30px" style="vertical-align: middle" align="right" nowrap="nowrap">
<label>
@Html.Resource("Reports_Brand")</label>
</td>
<td width="130px" style="vertical-align: middle" align="left">
@Html.DropdownField("Reports_Brand", Portal.Framework.Mvc.ViewDataPreparers.BrandsPreparerW.ViewDataKey, 2, new { style = "width:130px;" })
</td>
<td width="30px" style="vertical-align: middle" align="right" nowrap="nowrap">
<label>
@Html.Resource("Reports_Portal")</label>
</td>
<td width="130px" style="vertical-align: middle" align="left">
@Html.DropdownField("Reports_Portal", Portal.Framework.Mvc.ViewDataPreparers.PortalsPreparerW.ViewDataKey, 2, new { style = "width:130px;" })
</td>
<td width="30px" style="vertical-align: middle" align="right" nowrap="nowrap">
<label>
@Html.Resource("Default_Language")</label>
</td>
<td width="30px" style="vertical-align: middle" align="left">
@Html.DropdownField("Reports_Language", Portal.Framework.Mvc.ViewDataPreparers.LanguagesPreparerW.ViewDataKey, 2, new { style = "width:130px;" })
</td>
<td width="30px" style="vertical-align: middle" align="right" nowrap="nowrap">
<label>
@Html.Resource("Reports_PlayerProductType")</label>
</td>
<td width="30px" style="vertical-align: middle" align="right" nowrap>
@Html.DropdownField("Reports_PlayerProductType", Portal.Framework.Mvc.ViewDataPreparers.ProductTypesPreparerW.ViewDataKey, 2, new { style = "width:130px;" })
</td>
<td colspan="3"> </td>
</tr>
即使我改变了窗户尺寸,我还能做些什么才能让每个下拉停留在页面上?
答案 0 :(得分:0)
尝试以百分比(%)设置元素的宽度,而不是以像素为单位给出宽度。这样,元素将根据窗口的大小进行调整。