blogsmith Posted April 27, 2006 Share Posted April 27, 2006 I use things like <span style="color: rgb(192, 192, 192);">Books from Amazon</span> which I think is depracated. Is that correct? What is correct? Thanks. Link to comment Share on other sites More sharing options...
justsomeguy Posted April 27, 2006 Share Posted April 27, 2006 Well, I don't think that's deprecated, in fact I think that should work. But I've never used rgb myself, I always use hex, which is widely supported. 192 in hex is C0, so you can write the same thing like this:<span style="color: #C0C0C0;"></span>If you need to convert from decimal to hex, you can either fire up your chosen image editing program like Paint Shop Pro or Photoshop and do it there, or you can open the Windows calculator, select scientific mode (View -> Scientific), make sure the "Dec" radio button is checked, type in your number, and hit the "Hex" radio button to convert. Link to comment Share on other sites More sharing options...
Jonas Posted April 27, 2006 Share Posted April 27, 2006 It certainly isn't deprecated, it's just as you should declare color. The "font" tag is what is deprecated. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title>Untitled document</title></head><body>[b]<span style="color: rgb(192, 192, 192);">Books from Amazon</span>[/b]</body></html> Put that code in the textbox here:http://validator.w3.org/and you'll see that it's indeed valid xhtml. Link to comment Share on other sites More sharing options...
EvilChicken Posted April 27, 2006 Share Posted April 27, 2006 I use things like <span style="color: rgb(192, 192, 192);">Books from Amazon</span> which I think is depracated. Is that correct? What is correct? Thanks.<{POST_SNAPBACK}> Just use hex like he does. On the w3schools website they have a whole section on hex colors. Link to comment Share on other sites More sharing options...
Kosher Kid Posted May 1, 2006 Share Posted May 1, 2006 you don't need to use the hex identifier (#) in making your statement:<span style="color:c0c0c0"><p>test</p></span>will get you where you want to go. Link to comment Share on other sites More sharing options...
raimo Posted May 1, 2006 Share Posted May 1, 2006 you don't need to use the hex identifier (#) in making your statement:<span style="color:c0c0c0"><p>test</p></span>will get you where you want to go.<{POST_SNAPBACK}> Where You get that? Hex idtenfier MUST be there! It does not mean if it works with MSIE without that identifier, it can be throwed out of the code! Test it by pushing hereInvalid number : color c0c0c0 is not a color value : c0c0c0If HEX colors are used there MUST be always # -mark with value. Link to comment Share on other sites More sharing options...
Kosher Kid Posted May 1, 2006 Share Posted May 1, 2006 for me, it works with both ie and firefox so i just straightlined it from there. if it's required for other browers, then it is. my bad, i guess. thanks for the correction. Link to comment Share on other sites More sharing options...
Kosher Kid Posted May 1, 2006 Share Posted May 1, 2006 as a follow up, i was using span and color in a different way. interestingly enough, i validated the following code on w3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><title>Title</title></head><body><h1>test <span style="color:00ff00">test this phrase</span> head</h1></body></html> and it passed just fine. however, it did not display properly in either firefox or i.e. once the hex identifier was added, it displayed as expected.interesting. Link to comment Share on other sites More sharing options...
scott100 Posted May 1, 2006 Share Posted May 1, 2006 That's interesting, maybe a bug in the validator or something Link to comment Share on other sites More sharing options...
Jonas Posted May 1, 2006 Share Posted May 1, 2006 I think perhaps the (x)html validator just validates html stuff, so the content within the style attribute should be validated by the css validator. Link to comment Share on other sites More sharing options...
Kosher Kid Posted May 1, 2006 Share Posted May 1, 2006 jonas is kerrect...the css validator did complain about the lack of a hex identifier.i guess this should be a warning to be careful if you specify css styles within an html page or inline within an element. if you don't use the hex your colors will not be blest.coder beware! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now