<div>
<table width="600px" border="0" cellspacing="1" cellpadding="1">
<tr>
<td style="width:110px">
<div>
Login Type
</div>
</td>
<td style="background: #f8f8f8; width:483px">
<div>
<asp:DropDownList ID="ddlLoginType" runat="server" Width="190px">
<asp:ListItem Value=""></asp:ListItem>
<asp:ListItem Value="1">A</asp:ListItem>
<asp:ListItem Value="2">B</asp:ListItem>
</asp:DropDownList>
</div>
</td>
</tr>
<tr>
<td style="width:110px">
<div>
Login Name
</div>
</td>
<td style="background: #f8f8f8; width:483px">
<div>
<asp:TextBox ID="txtLoginName" runat="server" Width="190px"></asp:TextBox>
</div>
</td>
</tr>
</table>
</div>
这样做之后,发现DropDownList和TestBox的宽度不一致 但我都设置成了190PX 不知道是什么原因??
1.去掉控件的WIDTH属性
2.增加CSS
#ddlLoginType
{
width:190px;
}
#txtLoginName
{
width:190px;
}