Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts

    Exclamation The validator takes exception to some of the following css. NOW SORTED.

    The validator takes exception to some of the following css.
    Generally about colour info missing.

    I did not write this code, but it has worked faultlessly.

    Any pointers as to what would make w3 validator happy?

    Frank

    Code:
    #content {
      float: left;
      font: 10px Arial, Helvetica, sans-serif;
      text-decoration: none;
      width: 20%;
      margin-top: 50px;
      margin-left: 26px;
      padding: 5px;
      text-align: left;
    }
    
    #links {
      clear: left;
      color: white;
      font: 10px Arial, Helvetica, sans-serif;
      line-height: 1.2;
    }
    
    #links ul {
      margin: 0;
      padding-left: 3px;
      color: white;
      list-style: none;
    }
    
    #links ul li {
      padding-left: 20px;
    }
    
    #links ul a {
      color: white;
      font-size: 1.3em;
      font-weight: normal;
      text-decoration: none;
    }
    
    #links ul a:hover {
      text-decoration: underline;
    }
    
    #footer {}
    
    h1 {
      color: #f00;
      text-align: center;
    }
    
    #cap {
      font-size: 50px;
      color: #FF0;
      font-weight: bold;
      float: left;
      height: 34px;
      line-height: 24px;
      margin-top: 2px;
      margin-right: 1px;
    }
    
    * html #cap {
      margin-right: -2px;
      margin-top: 3px;
    }
    
    #valids {
      clear: both;
      margin: auto;
      width: 176px;
      padding: 2px;
    }
    Last edited by effpeetee; 10-24-2007 at 10:54 AM.
    * Sources (updated: 21.11.2012.
    Using Windows 8 Professional. 64bit with HP Photosmart 5510 printer Very useful site here.

  • #2
    Regular Coder
    Join Date
    Feb 2007
    Location
    Canada
    Posts
    924
    Thanks
    10
    Thanked 56 Times in 55 Posts
    It likes that you set a background colour when you set a colour, but this snippet validates for me as a direct entry

  • #3
    New Coder
    Join Date
    Oct 2007
    Posts
    49
    Thanks
    5
    Thanked 9 Times in 9 Posts
    Quote Originally Posted by jlhaslip View Post
    It likes that you set a background colour when you set a colour, but this snippet validates for me as a direct entry
    Depending on the doctype, it will validate without setting a background color. I know that Strict doctypes always need both.

  • #4
    Regular Coder
    Join Date
    Feb 2007
    Location
    Canada
    Posts
    924
    Thanks
    10
    Thanked 56 Times in 55 Posts
    yes, and the snippet has no Doctype, so I assume the Original poster is carrying a strict Doctype, hence the reply.

  • #5
    Regular Coder Jutlander's Avatar
    Join Date
    Jun 2007
    Location
    In my own sick little world :P
    Posts
    425
    Thanks
    1
    Thanked 12 Times in 12 Posts
    Quote Originally Posted by dcostalis View Post
    Depending on the doctype, it will validate without setting a background color. I know that Strict doctypes always need both.
    My blog is valid HTML 4.01 Strict and so is the CSS. I have set a color on several occasions without setting a background color and it doesn't complain at all.
    .
    .

  • #6
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    It's very weird.

    I checked it on the IE toolbar, but just now I have checked it direct and it is OK.

    Both times it used the W3 validator.

    I have had this problem in the past when checking with the IE toolbar has given a different result. It will need to be watched.

    Frank

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    * Sources (updated: 21.11.2012.
    Using Windows 8 Professional. 64bit with HP Photosmart 5510 printer Very useful site here.

  • #7
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,641
    Thanks
    0
    Thanked 649 Times in 639 Posts
    When you set a color without a background-color (or vice versa) you are relying on no one setting the other to the same color and thus making the content invisible. Remember that you are not the only one who can define styles for your page, all your visitors can too.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #8
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    Quote Originally Posted by felgall View Post
    When you set a color without a background-color (or vice versa) you are relying on no one setting the other to the same color and thus making the content invisible. Remember that you are not the only one who can define styles for your page, all your visitors can too.
    I can see the sense of setting the color, but can't they alter it anyway, even if I have set the color?

    If I don't set the color, does it inherit it from the parent, or what happens?

    I still have a way to go to understanding the cascade. ( as well as many other things)

    Frank
    * Sources (updated: 21.11.2012.
    Using Windows 8 Professional. 64bit with HP Photosmart 5510 printer Very useful site here.

  • #9
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,785
    Thanks
    8
    Thanked 131 Times in 129 Posts
    The code will still validate. It has no errors just warnings. Warnings to make invalid code. What the background color for your color is there for, is to make sure there is enough contrast between colors. Teh biggest one is, eg. if your using dark text make the background color of the highest parent (if possible) a light color and visa versa. Not only will this make sure all the text is legible with images turned off (if using a background image) but will make sure that when text is highlighted, it's a high contrast highlight.

    for instance if you make a page with a black background color and black text, and you use only a background image with no color for the background of the content area, when you highlight it, it will default to black on white (unless the user has changed the default). the result is that while you are highlighting the text, you can't tell you are.
    Stop making things so hard on yourself.
    i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis

  • Users who have thanked harbingerOTV for this post:

    effpeetee (10-24-2007)


  •  

    Posting Permissions

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