Multiple colors of text on one line |
Multiple colors of text on one line |
Styler001 |
Jan 14 2007, 09:22 PM
Post
#1
|
Group: Members Posts: 8 Joined: 14-January 07 Member No.: 1,573 |
Maybe it's because I'm a huge noob at this, but I can't figure out how to go about displaying words with different colors on the same line. I can get them to list one after the other down the page, but not on the same line.
I know I could do something like <font color = "red">, but I also know that the <font> tag has been deprecated. I just don't know how to manage this using styles instead. What I'd like is something like: Red Blue Green Orange Purple Black Instead of: Red Blue Green Orange Purple Black I know this is probably like Noob 101, but I can't figure it out. If you could help me out (without laughing at me too much), I'd really appreciate it. |
pandy |
Jan 14 2007, 11:13 PM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
How do you get them one efter the other?
Yeah, FONT is uncool. This isn't much cooler, but to do what you want you need to wrap each word in an element. CODE <span class="red">Red</span> <span class="blue">Blue</span> <span class="green">Green</span>... Then you use CSS to style those classes. |
Styler001 |
Jan 15 2007, 12:51 AM
Post
#3
|
Group: Members Posts: 8 Joined: 14-January 07 Member No.: 1,573 |
I don't know if this is the proper way to do it, but it worked. I already had the <pre> tag defined for something else, so I used it again.
CODE <pre><span style="color: blue">Blue</span> <span style="color: red">Red</span> <span style="color: purple">Purple</span> <span style="color: orange">Orange</span> <span style="color: green">Green</span> <span style="color: black">Black</span></pre> I guess I could have put the blank spaces in with the text, but either way, it works out OK. Thanks for the quick response. |
Lo-Fi Version | Time is now: 19th April 2024 - 12:24 AM |