C# .NET - how to give the color to the font in htmltag

Asked By pradeep kumar on 10-Nov-11 05:04 AM
how to give the color to the font in htmltag
Chintan Vaghela replied to pradeep kumar on 10-Nov-11 05:06 AM
HEllo,

<body style="color: red;">


hoep this helpful
Suchit shah replied to pradeep kumar on 10-Nov-11 05:09 AM

You can use as follows:
Your ASPX page like:

<head runat="server">
</head>
<body>
    <form id="form1" runat="server">
    <div>
   <asp:Label ID="Label1" runat="server"></asp:Label>
    </div>
    </form>
</body>
</html>

CS page

protected void Page_Load(object sender, EventArgs e)
    {
      Label1.Text = "I m .Net <font color='red'>developer.</font>";
    }

dipa ahuja replied to pradeep kumar on 10-Nov-11 05:09 AM
You cannot give color to <html> tag

but you can set color to any particular control this way

<input id="Text1" style="color:Gray" type="text" /> 

To set color to all controls on page

<bod style="color:Silver">
Kirtan Patel replied to pradeep kumar on 10-Nov-11 05:10 AM
<font color="red"> This is Sample Text </font>

output : This is Sample Text
Jitendra Faye replied to pradeep kumar on 10-Nov-11 05:14 AM
Use this code-

<font size="3" color="red">This is some text!</font>

<font size="2" color="blue">This is some text!</font>

<font face="verdana" color="green">This is some text!</font>



Try this and let me know.
Riley K replied to pradeep kumar on 10-Nov-11 05:19 AM

Use the Font Tag to set the color

for example

<font color="#990000">This text is hexcolor #990000</font>


Regards