我目前对此有疑问。我的网页右侧有很多多余的填充(http://openset.azurewebsites.net/).I 希望页面适合屏幕。在做了一些调查工作后,我找到了导致它的对象,它是我的 <asp:TextBox/>
在用户输入他们的电子邮件地址。搜索 CSS 后,我找不到任何类型的 TextBox 多余的 padding
属性,我不知道如何更正它。
相关代码是:
<div class="pull">
<asp:TextBox ID="AddEmailName" runat="server" Text="Enter your e-mail here"
onfocus="if(this.value == 'Enter your e-mail here') this.value = '';"
onblur="if(this.value == 'Enter your e-mail here' || this.value == '') this.value = 'Enter your e-mail here';"
style="text-align:center" Width="300px" Font-Size="Large"></asp:TextBox>
<asp:Button ID="AddEmailButton" runat="server" width="100px"
backcolor="#c7b099" forecolor="#000" Text="Notify Me"
OnClick="AddEmailButton_Click" CausesValidation="true" />
</div>
CSS:
.pull {
position: relative;
left: 525px;
}
最佳答案
问题是 left: 525px
移动了 div,但宽度保持在 100%。您应该改用 padding-left: 525px
或 margin-left: 525px
。
关于html - 填充 ASP 文本框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15497744/