TUTORIALBackendFETCHED

ASP.NET Width 属性

ASP.NET Width 属性 Style 控件 定义和用法 Width 属性用于设置或返回控件的宽度。 语法 <asp:webcontrol id='id' Width='value' runat='server' /> 属性 描述 value 控件的宽度。必须是像素值,或表示父对象宽度的百分比值。 实例 ..

Updated 7/16/2026

Tutorial detail pages default to noindex.

ASP.NET Width 属性


Style 控件 Style 控件

定义和用法

Width 属性用于设置或返回控件的宽度。

语法

<asp:webcontrol id="id" Width="value" runat="server" />

属性 描述
value 控件的宽度。必须是像素值,或表示父对象宽度的百分比值。


实例

下面的实例设置了 Button 控件的宽度:

<form runat="server">
<asp:Button id="button1" Text="Submit"
Width="150px" runat="server" />
</form>

演示实例 »

Style 控件 Style 控件