CSS code:
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <style type="text/css"> .border0 { color: blue; border: 0; background-color: transparent; } </style></head><body> <form id="form1" runat="server"> <div> <asp:Button ID="btnTest" runat="server" Text="点击测试" Enabled="false" CssClass="border0" /> <asp:Button ID="Button1" runat="server" Text="点击测试" CssClass="border0" /> </div> </form></body></html>
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <style type="text/css"> .border0 { color: blue; border: 0; background-color: transparent; } .border1[disabled="disabled"] { color: gray; border: 0; background-color: transparent; } .F { color: red; } </style></head><body> <form id="form1" runat="server"> <div> <asp:Button ID="btnTest" runat="server" Text="点击测试" Enabled="false" CssClass="border0 border1" /> <asp:Button ID="Button1" runat="server" Text="点击测试" CssClass="border0 border1" /> <asp:Button ID="Button2" runat="server" Text="点击测试" Enabled="false" CssClass="F border1" /> </div> </form></body></html>