Click to See Complete Forum and Search --> : please help with html code!!
evan5
11-21-2008, 03:14 AM
Hi there,
My webpage is split up in <td>, and on one <td> i have a background color which is sort of gray, the code is:
<td width="60%" valign="top" bgcolor="1C1D1C" border="3" bordercolor="pink">
the background color wirks great in IE, just how i want it to look, but in stupid firefox :/ ..... it doesnt show up. It does if I put basic colors like "blue" or "pink" but 1c1D1c does not work in firefox, can sum1 please sugges what I should do.
Thanks much!!!:)
Shanu.chaudhary
11-21-2008, 04:50 AM
I dont know what the issue with you...coz I tried that and it worked fine for me...
coothead
11-21-2008, 05:17 AM
Hi there evan5,
can someone please suggest what I should do.
Yes, stop coding slovenly. ;)
IE, may well accept poor coding but compliant browsers do not.
The attribute bgcolor is deprecated in favour of CSS.
I would presume that this is maybe a mystery to you and probably you would
only be able to implement inline styling at your present level of coding.
If this is the case use, instead of bgcolor="1C1D1C"...
style="background-color:#1c1d1c"
Further reading:-
Get the basics of CSS here...
http://www.w3schools.com/css/default.asp
coothead
evan5
11-21-2008, 11:58 AM
thank you Coothead!!
that worked! i'm actually pretty familliar with cascading, just was'nt sure how to make the <td> in cascading, because I have more than one <td> on my pages.. would it be like
td1
{........
......
}
that way, or somethning like dat?
thanks again for the help
coothead
11-21-2008, 12:15 PM
Hi there evan5,
give a single element that you wish to style an id selector.
Give multiple elements that you wish to style a class selector.
Further reading
CSS2 selectors (http://www.w3.org/TR/CSS2/selector.html)
Class selectors (http://www.w3.org/TR/CSS2/selector.html#class-html)
ID selectors (http://www.w3.org/TR/CSS2/selector.html#id-selectors)
coothead
Major Payne
11-22-2008, 02:22 PM
Highly recommend the suggestions made for coding, but to answer your question directly using your style of coding, the "problem" you had with Firefox is the missing " # " in " bgcolor="1C1D1C" ". Firefox is almost totally compliant with CSS 2.1 and HTML 4.01 Standards and will not parse a color without the " # ".
Also, do not recommend using named colors. Some named colors, although having different names, will generate the same color because the browser does not know the difference.
evan5
11-22-2008, 04:15 PM
"Also, do not recommend using named colors. Some named colors, although having different names, will generate the same color because the browser does not know the difference. "
what do you mean by that MP?
Major Payne
11-22-2008, 07:42 PM
Both Magenta and Fuchia (http://www.w3.org/TR/css3-iccprof#x11-color)use #ff00ff.