Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7
  1. #1
    Senior Member Karloff's Avatar
    Join Date
    Oct 2005
    Posts
    744
    Member #
    11702
    Hi,

    for a site i'm designing i'm getting quite a few warning messages saying

    You have no background-color with your color : .header h2
    You have no color with your background-color : #content
    Same colors for background-color and border-right-color : #activities_box

    i didn't think these would be a problem as it would inherit the color from the div or what not.

    now i can go and fix these problems but was wondering if anyone could enlighten me to why this is causing a warning?

    ps : is there a shortcut to end the warnings or do i have to amend all the tags?

    cheers

  2.  

  3. #2
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Well, you're right, you do inherit the color from whatever other classes there are. The warning is there because that's not necessarily desired behavior. Say all your divs except for #blackDiv have black text and a white background, and you set the background in #blackDiv to be black. It inherits the black text from everywhere, and it's illegible. Warnings are there to let you know there's a potential issue that might crop up now or in the future. Generally speaking, it's about good style that avoids such issues.

    As for the border and background color, the idea is that if your border is the same color as your background, they're indistinguishable, so why bother having a border :-)

  4. #3
    Senior Member Karloff's Avatar
    Join Date
    Oct 2005
    Posts
    744
    Member #
    11702
    still don't really understand it. Was having a look at many other websites which had valid CSS but didn't define the background-color of h1, h2..... etc?

    the border problem..... i see what you mean:classic:

    cheers

  5. #4
    Senior Member minute44's Avatar
    Join Date
    Mar 2006
    Location
    Nottingham, UK
    Posts
    264
    Member #
    12849
    Well, your CSS is still valid if it has warnings in it... It's just good practice to try and eliminate them. I get the feeling that the warnings for your <h*> tags are very context sensetive. Some times they will not show up as warnings but other times they will it all depends on the cirumstances I believe.
    No ma'am, we in IT don't have a sense of humor we're aware of.

  6. #5
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Do note that the problem isn't that you *didn't* define the background-color for your h1, but rather that you *did* define the color but not the background color. Remember, the validator doesn't really know which colors will go where, so it just warns you when there's the potential for something to become invisible because of similar colors conflicting.

  7. #6
    Senior Member Karloff's Avatar
    Join Date
    Oct 2005
    Posts
    744
    Member #
    11702
    cool, thanks for the advice guys!!

  8. #7
    Senior Member
    Join Date
    Feb 2005
    Location
    Canada
    Posts
    435
    Member #
    8983
    I hope this helps:
    You have no background-color with your color : .header h2
    this is caused by using "background:" instead of "background-color:"

    Same colors for background-color and border-right-color : #activities_box
    This is just saying you won't see the border so whats the point.

    You have no color with your background-color : #content
    This is simply neglecting to add a text color to the tag.
    or you neglected to add a color eg color:;
    Thee Pyro Wolf


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:54 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com