Forum Moderators: open

Message Too Old, No Replies

table bgcolor in NS7.02 not recognized - known bug?

bgcolor in NS7.02 not recognized

         

webbyaz2

7:15 pm on Aug 29, 2004 (gmt 0)

10+ Year Member



I just do not get this.

I have a table with populated cells. It has a bgcolor.

The color is recognized in IE and NS Navigator (4.5!) but NOT in NS7.02. What gives? I am driving myself crazy.

The workaround is to use a background image for the page, or to set a background color for the page. I just can't stand not knowing why this doesn't work the way it *should* by setting bgcolor for the table - searched the archives & found no reference. HEre's the code:

<body>
<table width="796" border="0" cellspacing="0" cellpadding="0" bgcolor="6666FF">

Thanks in advance...

tedster

7:21 pm on Aug 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to the forums!

bgcolor is a deprecated attribute [webmasterworld.com] - use CSS and you should have better results cross-browser. No way to tell how long any browser support will be given for deprecated attributes, so it's better to future-proof your mark-up.

style="background-color:#6666FF;"

Also consider handling all the other attributes of your table with css - ideally in a seperate .css file. That way you can control border, padding, etc for each individual cell as well as the whole table and create very pleasing visual effects.

encyclo

8:13 pm on Aug 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<table width="796" border="0" cellspacing="0" cellpadding="0" bgcolor="6666FF">

You're probably using a full doctype which switches Netscape 7 into standards-compliance mode. The above use of bgcolor is missing the "#" before the color value. In quirks mode (which emulates the bugs of older browsers such as Netscape 4.7) this is permitted, but in standards-compliance mode it won't work.

You should try using

[b]bgcolor="#6666FF"[/b]
instead. Should fix your problem.

See also Quirks Mode and Standards Mode [webmasterworld.com] for more information.

You should also run your page through a validator, which will help you pick up on such problems more easily in the future:

[validator.w3.org...]

tedster

8:14 pm on Aug 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Right you are, encyclo - I missed that piece!

webbyaz2

3:36 pm on Aug 30, 2004 (gmt 0)

10+ Year Member



Ah! I totally missed the "#" - usually use that somehow did not..

Will try that; I'm sure that's it.