• i’ve solved all but ONE of my w3c XHTML errors. The last one resides in my footer. i have a few links for “about us”, “contact”, etc. and need them centered. Here is my current code from footer.php:

    </body>
    <div align='center'>
    <p></p>
    <a href="https://www.undertheblackhat.com/contact">contact</a>
    <a href="https://www.undertheblackhat.com/credits">credits</a>
    <a href="https://www.undertheblackhat.com/disclaimer">disclaimer</a>
    <a href="https://www.undertheblackhat.com/policies">policies</a>
    </div>
    </html>

    The resulting error from the W3C validator is:

    Error Line 360 column 19: document type does not allow element "div" here.
    <div align='center'>

    I’ve discovered that the regular <center> code has been deprecated. Is there an easy solution for this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • where is your closing </body> tag? you cant have tags like that outside of your closing </body> tag?

    it goes like this:

    <html>
    ....
    <body>
    ...
    <div>
    ....
    </div>
    </body>
    </html>

    Thread Starter jdarby

    (@jdarby)

    i noticed the same thing. the default setup in this footer.php only had the ending tags for the </html> and </body>

    Thread Starter jdarby

    (@jdarby)

    I have achieved a point to where my page validates with w3c, but I am not totally satisfied with the result. I get my footer to display without having errors, but it doesn’t display where I would like it to.

    The blog is at https://www.undertheblackhat.com . I put text at the bottom where the footer currently displays and where i want it to. Here is my current footer.php:

    <div id="footer">
    FOOTER TEXT DISPLAYS HERE
    </div> <?php /* footer */ ?>
    </div></div></div></div></div></div></div></div></div></div> <?php /* postcolumn */ ?>
    <div style="clear: both"></div>
    </div> <?php /* page_container */ ?>
    <?php do_action('wp_footer'); ?>
    </body>
    <center>I WANT FOOTER TEXT TO DISPLAY HERE!
    </html>

    Whenever I try to add text below in the white area underneath the post area, w3c tells me:

    “The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements — such as a “style” element in the “body” section instead of inside “head” — or two elements that overlap (which is not allowed).”

    Any help or guidance is appreciated, thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘w3c footer validation help!’ is closed to new replies.