SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Addict goma's Avatar
    Join Date
    Jan 2002
    Location
    smelly armpit of Asia
    Posts
    305
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What's with the warning from the W3C CSS validator?

    I keep getting background and color warnings when I validate my stylesheet. I can get rid of the error (if there are any) but if I try to fix the color and background color to get rid of the warnings, my layouts turns to crap. It works perfectly in different browsers so I don't see what the problem is with the warnings.

  2. #2
    SitePoint Wizard Ian Glass's Avatar
    Join Date
    Oct 2001
    Location
    Beyond yonder
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think all you need to do is supply a background color when you specify a foreground color and vice-versa. 'Background-color: transparent' might easily solve your problem. :-)

    ~~Ian

  3. #3
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That is just the W3C validator's way of panicking in case your text color doesn't contrast enough with the whatever default background color the user has their browser set to use (or as Ian points out, vice versa).
    It doesn't take into account the various ways text may be presented within a page.
    It takes all classes on a one by one basis checking the presence foreground with background and panicking if only one is specified.

    Many people are perfectly happy to leave those warnings in as they are only warnings and do not neccessarily invalidate the CSS.
    Some prefer to get it 100% cleared- no errors, no warnings.

    If you want to post a url to the site then perhaps I and others can take a look and hopefully help you find a good workaround that helps you validate it 100% without wrecking the appearance of your site.
    Last edited by Bill Posters; May 5, 2002 at 11:18.
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  4. #4
    SitePoint Addict goma's Avatar
    Join Date
    Jan 2002
    Location
    smelly armpit of Asia
    Posts
    305
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    here's the site:

    http://www.soapbox101.com

    I'd really appreciate it if you could also tell me if you notice any CSS bugs that might crop up..

    thanks

  5. #5
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It all seems to work close to perfectly on my set-up (see below)

    There is a little inconsistancy with the width of the 'text' div ('feed', 'games' and 'bio' being slightly more narrow than the others and 'links' starting wider, but resizing after render), but this has minimal impact on the page.
    I only mention this as it appears you have tried to be as consistant as possible.

    Code wise, I see you have omitted *some* of the quotes around class names (but not all).
    It is at least worth standardising your use of them (i.e. all *with* or all *without*)
    Personally I'd get in the habit of all *with* as it's neccessary to include them if/when you move along to XHTML standards.

    The only other thing I think could be done differently would be to swap all the nbsp in the menu for a padding-left property.
    At the moment the menu shifts slightly onmouseover.
    Perhaps simply adding a 1px border (in the same colour as the menu's background) to the links normal state would prevent the shift.

    I'll take a look at the CSS file and validation warnings later when I have a little more time.
    Again, don't think that they are an essential thing.
    EVen W3C only considers them as something to be aware of and doesn't fail you validation because of them.

    Fwiw, the CSS file for this forum has plenty of warnings when run through the validator, yet it still 'validates'.

    Also, fwiw, as Ian says, using background: transparent; will definately clear up some of them (though it doesn't address the potential issue that causes the warning in the first place- that of users' default bg/text colours)
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  6. #6
    SitePoint Addict goma's Avatar
    Join Date
    Jan 2002
    Location
    smelly armpit of Asia
    Posts
    305
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the feedback..

    I wanted to use padding-left and right for the menu links but I wasn't able to get it to work inline in IE5. I think IE5 has a problem with this property if used inline. So I cheated with nbsp. It's messy but it'll do until I figure out this padding bug.

    The shift is probably caused by the border I put into the link to make it appear as a button onmouseover. Somehow it doesn't work in IE5.

    Oh, yeah, I missed those "" for the selectors. Thanks!

    I've noticed though that some sites get warning too on their stylesheet and still get validated (get to post the W3C CSS gif too). Is there some minimum # or warning to finally get the nod from W3C.

    Sorry about getting anal on this. I just hate it when I try to get something and I only go half way..

  7. #7
    Posts rarely lloydi's Avatar
    Join Date
    Jan 2002
    Location
    Swindon UK
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    About the transparent keyword.

    from memory, when I've used this it is ignored in Netscape 4 and instead displays a not-very-transparent shade of black.

    I would live with the warnings, personally.
    Build Your Own Web Site the Right Way!
    A beginners' HTML/CSS book with web standards at its heart
    The Ultimate HTML Reference
    A complete reference, in glorious hardback

  8. #8
    SitePoint Enthusiast
    Join Date
    Mar 2002
    Location
    Indianapolis
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Everything looks fine to me in IE 5.5

    In addition to Bill's fine comments...

    Consider changing the left position of the main panel from a fixed value to a percent value. IMO it would be better if the main panel moved closer to the browser edge on narrower screens.


Bookmarks

Posting Permissions

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