0

The Underscores starter theme offers a specific HTML structure:

div.site
    header#masthead.site-header

    div#content.site-content
        div#primary.content-area
            main#main.site-main
                /* Here goes either article or archive content */

    aside#secondary.widget-area
        section.widget /* Multiple widgets */

    footer#colophon.site-footer

The aside#secondary.widget-area seems to be out of place. Looks like it should be inside of div#content.site-content, as a sibling of div#primary.content-area.

Is there a specific reason why Underscores theme HTML is structured this particular way?

1

1 Answer 1

0

The .widget-area actually IS inside .site-content.

For anyone wondering why .content-area has a <main> child-element, rather than being the <main> element itself, here is the explanation:

It allows for CSS styling while preserving HTML5 semantics. Namely it allows for easier negative margin management as well as background and other styling (full explanation here).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.