Mega Code Archive

 
Categories / ASP.Net Tutorial / ASP Net Controls
 

Add style to asp

<%@ Page Language="C#"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server">     <title>Untitled Page</title>     <style rel="stylesheet" type="text/css"> body {   font-family: Verdana, Arial, Sans-Serif;   font-size: small; } .heading1 {   font-weight: bold;   font-size: large;   color: lime; } .heading2 {   font-weight: bold;   font-size: medium;   font-style: italic;   color: #C0BA72; } .blockText {   padding: 10px;   background-color: #FFFFD9;   border-style: solid;   border-width: thin; }          </style> </head> <body>     <form id="form1" runat="server">     <div>         <asp:Label CssClass="heading1" ID="Label1" runat="server" Text="This Label Uses heading1"></asp:Label>         <br />         This is sample unformatted text.<br />         &nbsp;<br />         <asp:Label CssClass="heading2" ID="Label2" runat="server" Text="This Label Uses heading2"></asp:Label>         <br />         Here's more unformatted text.<br />         <br />         &nbsp;<div class="blockText" id="DIV1" runat="server" >             This control uses the blockText style. This control uses the blockText style. This             control uses the blockText style. This control uses the blockText style.         </div>     </div>        </form> </body> </html>