Skip navigation
Currently Being Moderated

Help with W3 validation

May 7, 2012 8:54 AM

Tags: #cs5 #dreamweaver #javascript

I have 5 errors on my page:  http://www.healthquestpt.com/hpc/index.html and because these are related to working with an external javascript, I dont know how (or if I should) to fix them and have it all still work properly.  Any help is greatly appreciated!

 
Replies
  • Currently Being Moderated
    May 7, 2012 9:03 AM   in reply to BcSurvivor08

    The errors don't have anything to do with an external JavaScript.

     

    It's because you are using an XHTML Strict doctype.

     

    The problems in lines 77 and 78 are because you're using camel-case for onMouseOver and onMouseOut. In XHTML, the attributes must be all lowercase: onmouseover and onmouseout.

     

    The problem on line 108 is because the ampersand hasn't been encoded correctly:

     

    ?counter={a657bf54-87e8-6464-dd5e-a19c9a61d085}&template=simple"

     

    Should be this:

     

    ?counter={a657bf54-87e8-6464-dd5e-a19c9a61d085}&template=simple"

     

    Also, you're using the background attribute on a table cell. That's not permitted in XHTML strict.

     
    |
    Mark as:
  • Currently Being Moderated
    May 7, 2012 1:45 PM   in reply to BcSurvivor08

    align="center" and  bgcolor="#ffffff" are deprecated (obsolete) in XHTML.

     

    Use CSS to style your tables and cells.  If you want to center tables, use CSS width, and margin:0 auto.

     

    table {

    width: 500px;

    margin:0 auto;

    background-color: #FFF;

    }

     

     

    Nancy O.

    Alt-Web Design & Publishing

    Web | Graphics | Print | Media  Specialists 

    http://alt-web.com/

    http://twitter.com/altweb

    http://alt-web.blogspot.com/

     
    |
    Mark as:
  • Currently Being Moderated
    May 7, 2012 6:06 PM   in reply to BcSurvivor08

    The whole point of modern web standards is to keep HTML markup as simple as possible and use CSS for styles. 

     

    Where you have this:

     

    <td class="tabnav"  background="images/tab1.gif" width="120" height="25" valign="bottom">

     

    Change to this:

     

    <td class="tabnav">

     

    Then style .tabnav with CSS like so:

     

    .tabnav {

    background: url(images/tab1.gif) no-reapeat;

    width: 120px;

    min-height: 25px;

    vertical-align: bottom;

    }

     

    How to Develop with CSS?  (a must read)

    http://phrogz.net/css/HowToDevelopWithCSS.html

     

     

     

     

    Nancy O.

     
    |
    Mark as:
  • Currently Being Moderated
    May 8, 2012 4:40 AM   in reply to BcSurvivor08

    This line is wrong:

     

    background-image: url(../images/tab1.gif) no-repeat;

     

    It should be this:

     

    background: url(../images/tab1.gif) no-repeat;

     

    I have just tested it on your site, using Firebug to edit your CSS. The images show up. However, it looks as though they're in the wrong place. Since I don't know what your original design was, it's difficult to offer much more help.

     
    |
    Mark as:
  • Currently Being Moderated
    May 8, 2012 5:13 AM   in reply to BcSurvivor08

    Your short-hand css seems to be stopping the images from showing

     

    Change this:

     

    background-image:url(../images/tab1.gif) no-repeat;

     

    to:

     

    background-image:url(../images/tab1.gif);

    background-repeat: no-repeat;

     

     

     

    and add display: block; to the css for .tabnav1 and .tabnav2 (as shown below)

     

     

    .tabnav1 a{

    background-image: url(../images/tab1.gif);

    background-repeat: no-repeat;

        width: 120px;

         text-decoration: none;

        font-family: "arial narrow";

        font-weight: bold;

        font-size: 14px;

        color: #0052a4;

        display: block;

    }

     
    |
    Mark as:
  • Currently Being Moderated
    May 8, 2012 11:57 PM   in reply to BcSurvivor08

    BcSurvivor08 wrote:

     

    Its almost there.  If you can help me get the text to drop down to almost the bottom of the tab1.gif it will be perfect.

     

     

    Add some top padding to the anchor tags, see below - padding: 10px 0 0 0; - adjust as required to position

     

    .tabnav1 a{

    background: url(../images/tab1.gif);

    background-repeat:no-repeat;

    display:block;

    width: 120px;

    min-height: 25px;

    vertical-align: bottom;

    text-decoration: none;

    font-family: "arial narrow";

    font-weight: bold;

    font-size: 14px;

    color: #0052a4;

    padding: 10px 0 0 0;

    }

     
    |
    Mark as:
  • Currently Being Moderated
    May 8, 2012 11:58 PM   in reply to BcSurvivor08

    BcSurvivor08 wrote:

     

    So, since my images worked the way I had them, why does W3 validator say its an error.  I obiviously cannot achieve the appropriate look with css.  Why Why Why cant this be as simple as <td background image....>  I dont understand.....

     

    What do you mean  the validator says its an error?

     
    |
    Mark as:
  • Currently Being Moderated
    May 9, 2012 9:48 AM   in reply to BcSurvivor08

    Background is not a valid table attribute.  It is a style property.  To fix it, change this:

     

    <td class="tabnav" background="images/tab1.gif" width="120" height="25" valign="bottom">

     

    To this with an inline style:

     

    <td class="tabnav" style="background-image:images/tab1.gif" width="120" height="25" valign="bottom">

     

     

     

     

    Nancy O.

    Alt-Web Design & Publishing

    Web | Graphics | Print | Media  Specialists 

    http://alt-web.com/

     
    |
    Mark as:
  • Currently Being Moderated
    May 12, 2012 10:47 AM   in reply to BcSurvivor08

    When is an error not an error?

    W3C validation tests are simply a tool to help you spot the source of potential problems.   Not all browsers honor web standards. 

     

    Experienced developers know which validation errors are significant and which to ignore. Proprietary browser codes often don't validate. Codes to fix browser bugs don't validate. Codes for Facebook and Twitter buttons don't validate.  Should you stop using them?  Of course not.  If they don't create problems for your pages, don't worry about them.

     

     

     

    Nancy O.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points