PDA

View Full Version : Two difernt text colors


King_Critter
04-04-2006, 11:06 PM
I just started (i.e., yesterday) learning HTML, and everythings going pretty well -- until I tried to put two difernt colors of text on the same page. I just can't figure it out!
In case you don't know what I'm talking about, I want something like this:

I want this to be red

And this to be black.


Help would be greatly apreciated.

TimP
04-04-2006, 11:25 PM
Make sure to close your font tags.

<font color="red">red text</font>
<font color="green">green text</font>

Dayoh
04-05-2006, 5:01 AM
Instead of putting the name of the color you can also do the hex number for it, to give u a wider range of colors

King_Critter
04-05-2006, 1:13 PM
Thanks! I hadn't known about the <font color> tags, the only way I knew to change the text color was <body text="red">

SexForTwo
04-06-2006, 5:47 AM
You might want to note that <font color> is not a tag, but <font> is. color is an attribute for the <font> tag, as is size, face and whatnot.*

Seal
04-06-2006, 8:22 AM
or get in with the times and use <span style="color:red;">RED TEXT OMG</span> instead.

Modred
04-06-2006, 5:04 PM
If you've just started learning HTML, I suggest you try w3schools.com (http://www.w3schools.com/html/default.asp), if you haven't found it already. The tutorials aren't the most in depth, but they do have a complete reference of every HTML tag and interactive examples you can modifty and see what happens.

King_Critter
04-06-2006, 10:53 PM
Yeah, I've found w3schools -- but I found it kinda confusing. :cry:
I picked a copy of "Teach Yourself Web Publishing with HTML and XHTML in 21 Days" from my libreary today, and I heard it was pretty good.