Jump to content

Changing text color


SillyBilly

Recommended Posts

I am using this as a DTD

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 TRANSITIONAL//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Since color is deprecated, I have tried to use CLASS, DIV and SPAN but they put the words at the beginning of a new line, causing the words of the sentence to be out of order. I had no success with ID. I have read many articles, explanations and examples, but none I saw address my problem.I want to change the color of three words in a sentence, there, their, they're. For example, the 3 homonyms should be a different color than the others.When you write your sentence will you use there, their or they're correctly?Any comments or suggestions would be appreciated.

Link to comment
Share on other sites

<head><style>span.colour{color:#0000FF;}</style></head><body><p>some text<span class="colour">there</span> some more text <span class="colour">their</span> some more meaningless text <span class="colour">they're</span> blah blah blah <span class="colour">there</span></p></body>is that what you mean?

Link to comment
Share on other sites

I guess you were saying the use of color as follows
<font color="blue">blue text</font>

is deprecated?The color property used in css is still alive and kickin' ...

Thank you for the correct code. I mistyped. I use the color property for the font color in my CSS. But it is always best to have the correct terminology. I made another note.
Link to comment
Share on other sites

Thank you for the correct code. I mistyped.  I use the color property for the font color in my CSS.  But it is always best to have the correct terminology.  I made another note.

Just a follow-up to the above, because the code worked as expected when I made a new file with that code only, but it did not in my file. The reason was that I had another span that I did not name originally and it passed it down some of the attributes. Here is the code, which I corrected by naming the first span (.letter), and by adjusting the font-size in the second span.
<style type="text/css">span.letter{float:left;width:.07 emfont-color: #FFFFCC;font-size: 400%;font-family: verdana,helvetica,arial,serif;line-height: 80%}span.colour{color:#FFFFFF; font-size: 100%;}

I'm learning. Thanks for being patient. Now I'll work on the deprecated center.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...