SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Couple of css validation questions....

    Hi,

    Im trying to get my css to validate using the w3 validator.

    At the top i get the message:

    To work as intended, your CSS style sheet needs a correct document parse tree. This means you should use

    Can anyone explain this? Is it stopping my document from validating? I am using valid xhtml in conjunction with this css.

    Its fine apart from that but does throw up about 10 warnings, all of which go like this:

    Line : 188 (Level : 1) You have no color with your background-color : #form

    (*-why do i nedd to put a color? ive already specified the color in an earlier DIV and was relying on on inheritance. Do u have to specify a color everytime you specify a background?-*)

    Line : 162 (Level : 1) Same colors for color and background-color in two contexts #main and #content2 p



    and the corresponding CSS:

    #form {
    margin-left : 0;
    background-color : #f7f7f7;
    width : 98%;
    padding : 5px;
    margin-top : 10px;
    }


    #main {
    margin-left : 182px;
    width : 578px;
    background-color : #fff;
    }

    #content2 p {
    color:#fff;
    line-height : 17px;
    }
    Thanks for any help.

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,153
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)

    valid CSS and XHTML

    Are you validating from a URL or uploading the file? It seems there have been validator "quirks" with uploaded files. If from a URL revalidate you XHTML just to be certain.
    The color warnings are there because some users use custom style sheets. For example, say I have poor vision and need the background and text to be certain colors to be able to see the site easily. If you set one of the colors (but not the other) what would I see?

  3. #3
    Non-Member
    Join Date
    Jan 2005
    Location
    Netherlands
    Posts
    4,300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  4. #4
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi there,

    Its only warnings being thrown up. The page doesnt validate though. It doesnt say "this page validates" or whatever.

    Ive tried to cut and paste my text and use the direct input option but that doesnt seem to be working. You click submit and its not doing anything for me! Weird!

    Right, so everytime i use color or background-color i also have to specify the other one. Got you.

  5. #5
    Non-Member
    Join Date
    Jan 2005
    Location
    Netherlands
    Posts
    4,300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by elduderino
    Hi there,

    Its only warnings being thrown up. The page doesnt validate though.

    Right, so everytime i use color or background-color i also have to specify the other one. Got you.
    No, its just a warning, a reminder that you can make an error leaving a background color out

  6. #6
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,153
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)

    parse tree

    Quote Originally Posted by elduderino
    The page doesnt validate though.
    needs a correct document parse tree
    is referring to the XHTML page's node tree. When the page passes validation, the message should be absent from the CSS validation.

  7. #7
    SitePoint Member
    Join Date
    Jul 2005
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    parse error

    I am trying to learn css. I have a webpage http://coolebreeze.com/martiniandnuzzis.html
    that when I view it in IE it is perfect but when I view it through Firefox or Netscape the background color (plus someother issues) or in another case on another page the background image is not showing up. When I try to validate the css it comes up with parse error. Could this be my problem. I don't know what parse error is. Here is my style sheet code. I would appreciate any help. Thank you.
    Best regards
    Dennis
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>insideout recreation</title>
    <meta http-equiv="Content-Type"
    content="text/html; charset=iso-8859-1" />

    <style type="text/css">
    <!--

    body {
    background-color: #000000;
    }


    body, html {
    scrollbar-3dlight-color: black;
    scrollbar-arrow-color: black;
    scrollbar-darkshadow-color: black;
    scrollbar-face-color: white;
    scrollbar-highlight-color: blue;
    scrollbar-shadow-color: blue;
    scrollbar-track-color: black;
    }

    .centeredimage {
    text-align: center;
    display: block;
    margin-top: 5px;
    }


    .arial11{
    font-family: arial, helvetica, sans-serif;
    font-size: 11px;
    }

    .arial12{
    font-family: arial, helvetica, sans-serif;
    font-size: 12px;
    color: #ffff00;
    }

    ul#mainnav a:link, ul#mainnav a:visited {
    display: block;
    text-decoration: none;
    margin: 0;
    width: 88%;
    border-color: #00ffff;
    border: inset;
    padding: 6px 6%;
    background-color: #0000ff;
    font: bold 10pt/ 1.5 arial, sans-serif;
    color: #ffff80;
    }

    ul#mainnav a:link {
    color: yellow;
    }

    ul#mainnav a:hover {
    color: #ff8040;
    }


    a:link {
    color: yellow;
    background-color: transparent;
    }


    a:visited {
    color: red;
    background-color: transparent;
    }

    a:hover {
    color: red;
    background-color: transparent;
    }

    a:active {
    color: yellow;
    background-color: transparent;
    }


    #top {
    margin: 20px;
    padding: 10px;
    height: 100px;
    }


    #left {
    position: absolute;
    left: 10px;
    top: 170;
    width: 200px;
    }

    #right {
    position: absolute;
    right: 10px;
    top: 170px;
    width: 200px;
    }

    #center {
    margin-top: 0px;
    margin-left: 220px;
    margin-right: 220px;
    }

    #footer {
    margin: 20px;
    text-align: center;
    }


    p {
    font-family: verdana, arial, helvetica, sans-serf;
    text-align: center;
    color: white;
    font-size: 10px;
    font-weight: bold;
    margin: 0 0 16px 0;
    padding-bottom: 1px;
    padding-top: 1px;
    }

    ul {
    font-size: 11px;
    color: yellow;
    font-weight: bold;
    margin-left: 1%;
    margin-right: 1%;
    padding-left: 2%;
    padding-right: 1%;
    }

    ul#mainnav {
    list-style: none;
    }


    ul.disc {list-style-type: disc}
    ul.circle {list-style-type: circle}
    ul.square {list-style-type: square}
    ul.none {list-style-type: none}


    h1 {
    text-align: center;
    color: #0000ff;
    margin-left: 3%;
    margin-right: 5%;
    }

    h2 {
    text-align: left;
    padding-left: 2%;
    padding-right: 2%;
    color: yellow;
    }


    h3 {
    text-align: left;
    font-size: 18px;
    color: red;
    margin-left: 1%;
    margin-right: 1%;
    padding-left: 1%;
    padding-right: 1%;
    }

    h4 {
    font-weight: bold;
    font-size: 12px;
    text-align: left;
    color: white;
    border-color: red;
    border: groove;
    margin-left: 1%;
    margin-right: 1%;
    padding-left: 1%;
    padding-right: 1%;
    padding-bottom: 1%;
    padding-top: 1%;
    }



    h5 {
    text-align: center;
    color: #ff8000;
    margin-left: 1%;
    margin-right: 1%;
    padding-left: 1%;
    padding-right: 5%;
    }

    h6 {
    background-color: #00ff00;
    text-align: left;
    color: yellow;
    margin-left: 1%;
    margin-right: 1%;
    padding-left: 1%;
    padding-right: 5%;
    }

    -->

    </style>
    </head>
    </body>
    </html>

  8. #8
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,153
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)

    Css

    Hi dennisd, welcome to the forums,
    A while back, I was new to the forums and a bit confused with how they worked too, so I understand. But what you have done is not "post a reply", but what is known as "hi-jacking" elduderino's thread. Doing this can make threads really confusing with different questions and different answers being bounced around all over the place. Kinda more like a chat room than a forum.
    Some forum users seem to get very upset about this. I can't speak for elduderino, but I wouldn't worry about it this time, chalk it up to as a learning experience.
    Also, if you look above the reply text area, there is a row of icons. The pound/hash puts any selected text in a "code" box, the brackets in an html box, php - syntax colored code in a php box, and the "speech baloon" in a quote box. Using these makes posts a lot easier to read.
    So anyway, what you should do is go to the CSS forum, http://www.sitepoint.com/forums/forumdisplay.php?f=53
    maybe read any threads that look like they might be of help, maybe do an advanced search, or start a new thread, depending on what your problem is at the time.
    That said, I think your parse error is because of a missing body tag
    HTML Code:
    </style>
    </head>
    </body>
    should be
    HTML Code:
    </style>
    </head>
    <body>
    </body>
    As for CSS working in IE, but not in other browsers, hang on to your hat, 'cuz your gonna get plenty of feedback there.
    Again, welcome to the forums, they're a great place to both learn and help.

  9. #9
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey no worries DennisD, welcome to sitepoint!


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
  •