WordPress.org

Ready to get started?Download WordPress

Forums

w3c footer validation help! (4 posts)

  1. jdarby
    Member
    Posted 7 years ago #

    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="http://www.undertheblackhat.com/contact">contact</a>
    <a href="http://www.undertheblackhat.com/credits">credits</a>
    <a href="http://www.undertheblackhat.com/disclaimer">disclaimer</a>
    <a href="http://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?

  2. whooami
    Member
    Posted 7 years ago #

    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>

  3. jdarby
    Member
    Posted 7 years ago #

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

  4. jdarby
    Member
    Posted 7 years ago #

    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 http://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!

Topic Closed

This topic has been closed to new replies.

About this Topic