SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: CSS validation

  1. #1
    SitePoint Zealot
    Join Date
    Oct 2001
    Location
    Montreal, Canada
    Posts
    169
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS validation

    Hi, I'm currently re-designing my site and need some advice. My pages are already validating XHTML 1.0 but with CSS...

    I want to use boxes here and there in my pages, boxes that looks like this:

    Box

    Now, if I try to validate my CSS with the validator I get theses warnings:

    * Line : 9 Level : 1 Same colors for background-color and border-right-color : .sometitle
    * Line : 9 Level : 1 Same colors for background-color and border-bottom-color : .sometitle
    * Line : 9 Level : 1 Same colors for background-color and border-top-color : .sometitle
    * Line : 9 Level : 1 Same colors for background-color and border-left-color : .sometitle
    Here's my CSS (well, it's not my complete CSS, but it's the part that the validator doesn't like):

    Code:
    .sometitle {
    color: #f2e4ac; 
    background : #005eae; 
    border: 1px solid #005eae; 
    font-weight: bold;
    text-align: center;
    width: 200px;
    }
    .sometext {
    color: #000000;
    background: #FFFEFB;
    border: 1px solid #CEDBEF;
    padding: 10px;
    width: 200px;
    text-align: left;
    }
    Now, if I want the title box background and border to be the same color and the border of the text box to be another color, how can I do it (and validate)?

    Thanks for your help

    Mike
    Dis donc, qu'est-ce qu'il dit ce mec? Hein? Je comprends rien...

  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)
    Try getting rid of the border on the ".sometitle". :-)

    Also, keep in mind that the padding is suppose to be added onto the width and not taken away (IE simply gets that wrong before version 6). Look for my attachment to validate.

    Another point, you might be interested in auto-generated filler text. ;-)

    ~~Ian
    Attached Images Attached Images

  3. #3
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your CSS is already validating Warnings are not the same as errors - your CSS is valid, and the warning sare there for your benefit to advise you of possible problems. If you think it's a problem that your background colour and border colour are the same (meaning you won't be able to visually distinguish the background from the border) then you can fix it easily by changing the border colour, but if that's the visual effect you intended there's no reason to change it.


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
  •