-
Bad CSS or Bad Opera?
What is wrong with this page?
Code:
<html>
<head>
<style type="text/css">
body {
background-color: 6666CC;
}
p {
color: FF0000;
}
</style>
</head>
<body>
<p>This is an ugly page.</p>
</body>
</html>
I see what I expect to see in IE 5.0 and Netscape 6.1. I see red text on a white background in Opera 5.12, but black text on a white background in Opera 6.0.
***? Is Opera that messed up? I have it in document or author mode, and I have selected to use the author's CSS, but... what?
-
According to the CSS specs, for "accessibility" reasons, you have to set color and background color at the same time per tag.
-
I didn't see that, but it makes sense.
Code:
<html>
<head>
<style type="text/css">
body {
color: 000000;
background-color: 6666CC;
}
p {
color: FF0000;
background-color: transparent;
}
</style>
</head>
<body>
<p>This is an ugly page.</p>
</body>
</html>
Regretably, that makes no difference. Did I do it wrong?
-
Do the specs allow you to leave off the # in front of the color hex? I know you can use an alternate rgb() color format.
-
That was is it. It is now working in Opera 5.12 and 6. Now that I know the reason, I'm a (very) little upset that Netscape 6 didn't break, too.
Thanks.