Results 1 to 5 of 5

Thread: Bad CSS or Bad Opera?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140

    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?
    Travis, Kung Foo Journeyman
    As always, RTFM.

    WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
    Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
    YBMS, but Mozilla doesn't.

  2. #2
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    According to the CSS specs, for "accessibility" reasons, you have to set color and background color at the same time per tag.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    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?
    Travis, Kung Foo Journeyman
    As always, RTFM.

    WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
    Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
    YBMS, but Mozilla doesn't.

  4. #4
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    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.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    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.
    Travis, Kung Foo Journeyman
    As always, RTFM.

    WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
    Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
    YBMS, but Mozilla doesn't.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width