Jump to content

Problem With Rgb Color Values


webmaster

Recommended Posts

Read the message! bgcolor is not a supported attribute that you put in an element <tag>. You must use CSS. The property you want to mess with is background-color. FWIW, most developers use hex notation for color, so pure red = "#f00" or "#ff0000"

Link to comment
Share on other sites

Personally, I would only ever use a Strict DTD so as to ensure proper compatibility across all browsers. And besides, like DD pointed, the whole idea behind modern web browsing is to separate the HTML and CSS.

Link to comment
Share on other sites

Well, if your observations are showing that they don't work then there's no other possibility. Browser support for bgcolor using RGB values is very limited these days.In HTML, deprecated elements and attributes are ones that are only supported for backwards compatibility.

Link to comment
Share on other sites

They should work, regardless of being proper.
Unless its specifically stated in a current standard that an acceptable value for the bgcolor attribute is an RGB function, then you can't expect it to work.The HTML 4.01 specification states that the bgcolor attribute accepts a value of type color. [1]Looking up the color type, the W3C specifies that it is as thus:
6.5 ColorsThe attribute value type "color" (%Color;) refers to color definitions as specified in [sRGB]. A color value may either be a hexadecimal number (prefixed by a hash mark) or one of the following sixteen color names. The color names are case-insensitive.
This does not include RGB functions. Therefore, you cannot expect an RGB function to be recognised as a valid value for the bgcolor attribute.
Link to comment
Share on other sites

I am using this for a personal page that is not going to be published, more for experimental purposes. The rgb values work fine in IE, but not in Firefox. They should work, regardless of being proper.
still don't see you wouldn't want to follow proper coding techniques/standards. they are there for a reason, and you will only become a better developer for it. For personal or professional reasons regardless, there is typically a right and wrong way to do things. Since your starting out, I would start trying to learn the right way of doing things. It will just make your evolution as a designer that much easier and graceful.
Link to comment
Share on other sites

Deprecated stuff is evil... using Hex values gains more compatability, but you can also use just normal colours, like "green". Firefox version 3 last time I checked does not support RGB values, but it does support the bgcolor="". The customized browser at my university always updates to the latest version of HTML etc and ignores deprecated tags completely. So it's always best to stay up to date and try to avoid deprecated tags if possible.

Link to comment
Share on other sites

Guest FirefoxRocks

Personally there's only 2 valid issues I can think of for using Transitional vs Strict document types:1. <iframe>2. target=""Iframes can be put in conditional comments instead, although valid it isn't truly valid.Target can be reproduced using JavaScript but again, it is like tricking the validator and also it is less compatible.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...