C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » HTML »

Text with different color letters


Posted Date: 23 Oct 2009      Posted By: sudha      Member Level: Bronze     Points: 1   Responses: 9



Hi

can we write a css for text each character with different colors .
like Asp.net
A->Red
S->Green
p->yellow







Responses

Author: greeny_1984    23 Oct 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

Hi,

you can use font to achieve your functionality like



<font color="red">A</font><font color="green">S</font><font color="yellow">P</font>


Regards,
Greeny_1984

Rate this Response[Excellent/Good/Poor]
FRESHERS check this link
Need help from me join here



Author: Gaurav Arora    24 Oct 2009Member Level: DiamondRating: 4 out of 54 out of 54 out of 54 out of 5     Points: 6

You have to set color for individual letter but its difficult to sent in CSS because there you need Id, class element etc.

There are lot of new attributes which might be helpful for your query

Take a look:
http://www.msdn.microsoft.com/workshop/author/css/reference/attributes.asp.



Thanks & regards,
Gaurav Arora - Sr. Editor
Me in My Own Style



Author: Venkatesh Ellur    26 Oct 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

Hi You can write different classes to get the effect you want but all that you need to do is apply class for each character.

THIS POSTING IS PROVIDED WITH NO WARRANTIES, BEWARE OF BUGS IN THE ABOVE CODE; I HAVE ONLY PROVED IT CORRECT AS PER MY KNOWLEDGE, NOT TRIED IT.

Regards
--------------------------
Venkatesh Ellur
+919886417764
venkatesh.ellur@gmail.com



Author: Manindra Upadhyay    03 Nov 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

You need to create different css class for each character.


Author: vineeth kumar    04 Nov 2009Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

just use class in css or if u want for a particular letter means just give fornt colour
the best practice is by using class
.a
{
font_color=red;
}
call it were ever u want for a
u will get it in red colour
like this u can gave for other letters also



Author: Dhanesh.K.R    05 Nov 2009Member Level: BronzeRating: 2 out of 52 out of 5     Points: 2

It is much better to use the following HTML Code

<font color="red">a</font><font color="green">s</font><font color="yellow">p</font>

You can use CSS in two ways

1. using ID
2. using Class

Using ID, The code is as follows

<html>
<head>
<style type="text/css">
#a
{
color:red;
}
#s
{
color:green;
}
#p
{
color:yellow;
}

</style>
</head>
<body>
<div id="a">
a
</div>
<div id="s">
s
</div>
<div id="p">
p
</div>
</body>
</html>

Using Class, The code is as follows

<html>
<head>
<style type="text/css">
.a
{
color:red;
}
.s
{
color:green;
}
.p
{
color:yellow;
}

</style>
</head>
<body>
<div class="a">
a
</div>
<div class="s">
s
</div>
<div class="p">
p
</div>
</body>
</html>

Now you may find which one is easy



Author: jagadish    11 Nov 2009Member Level: BronzeRating: 2 out of 52 out of 5     Points: 2

body {color:blue}
h1 {color:#00ff00}
h2 {color:rgb(255,0,0)}



Author: Pavan    11 Nov 2009Member Level: BronzeRating: 2 out of 52 out of 5     Points: 2

<font color="red">A</font><font color="green">S</font><font color="yellow">P</font>


Author: sanitha    12 Nov 2009Member Level: BronzeRating: 2 out of 52 out of 5     Points: 2

mathod 1) we have to specify font color for each letter
method 2) dynamically build the HTML ,so that we can apply random colors for each character



Post Reply
You must Sign In to post a response.
Next : Only TBODY to scroll
Previous : Div problem using css in mozilla and firefox
Return to Discussion Forum
Post New Message
Category: HTML

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use