加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 为什么一个asp:DropDownList和一个相同宽度的asp:TextBo

发布时间:2020-12-15 03:55:02 所属栏目:百科 来源:网络整理
导读:我在表中使用下面的代码: tr tdUser Language:/td td asp:DropDownList ID="Language" runat="server" Width="200px" asp:ListItem Selected="True"English/asp:ListItem /asp:DropDownList /td/trtr tdspan class="important"*/spanCompany:/td tdasp:Text
我在表中使用下面的代码:
<tr>
    <td>User Language:</td>
    <td>
        <asp:DropDownList ID="Language" runat="server" Width="200px">
            <asp:ListItem Selected="True">English</asp:ListItem>
        </asp:DropDownList>
    </td>
</tr>
<tr>
    <td><span class="important">*</span>Company:</td>
    <td><asp:TextBox ID="Company" runat="server" width="200px" /></td>
</tr>

当代码出现在站点上时,< asp:Textbox>控件是205px,< asp:DropDownList>宽200像素是什么原因造成的?它们都设置为200px的宽度.

解决方法

因为文本框具有2px的边框和1px的padding两边.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读