WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Are nested div's OK? (4 posts)

  1. AmandaWA
    Member
    Posted 7 years ago #

    Is it allowable to have a div nested within another div?
    Eg.
    <div id="sidebar">
    <div id="author">
    </div>
    </div>

    I'm working through trying to fix W3C validation errors and I don't understand why it doesn't like the "author" div.

    Thanks

  2. TechGnome
    Moderator
    Posted 7 years ago #

    It should be OK...I hope so... my site uses a lot of nested divs.

    -tg

  3. moshu
    Member
    Posted 7 years ago #

    It is not aout nested divs.
    It is about inserting a div in ul - where it expects a li tag!

    Clicking the "show source" and revalidate will make the error line numbers clickable links that take you to the exact location of the error.

    Note. Most WP sidebars are built as nested lists (it comes handy when you want to use the sidebar widgets) - so a div inserted somewhere into the list... breaks it. That's why the validator "doesn't like it".

  4. AmandaWA
    Member
    Posted 7 years ago #

    Thankyou Moshu - that makes sense.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.