ASP.NET Style 屬性
定義和用法
Style 屬性用于向控件設(shè)置或返回內(nèi)聯(lián)的 CSS 樣式。
語(yǔ)法
<asp:webcontrol id="id" Style="style"
runat="server" />
值 | 描述 |
---|---|
style | 字符串,該值是為內(nèi)聯(lián)樣式表規(guī)定的 CSS 樣式。 |
實(shí)例
本例設(shè)置按鈕控件的 CSS 樣式:
<form runat="server">
<asp:Button id="Button" Text="Submit" runat="server"
Style="font: 12pt Verdana;font-weight:700;color:orange;"
/>
</form>
實(shí)例
- 使用 style 屬性向 button 控件添加樣式