Maybe this is too simple question, but I've tried to find out the info by myself.

How can I remove margins (all: left, top, right, bottom) for Twenty Twelve theme?

This is what I mean: WordPress screenshot

  • This is a pure CSS question and as such is off-topic per the faq
    – s_ha_dum
    Feb 11, 2013 at 16:51
  • @s_ha_dum, oh, sorry. What should I do with this question? (I thought it should be posted here because it requires knowledge of Twenty Twelve theme.) Feb 11, 2013 at 17:01

1 Answer 1


I think you mean these class definitions in style.css:

    /* =Media queries
    -------------------------------------------------------------- */

    /* Minimum width of 600 pixels. */
    @media screen and (min-width: 600px) {


        .site {
            margin: 0 auto;
            max-width: 960px;
            max-width: 68.571428571rem;
            overflow: hidden;



  /* Minimum width of 960 pixels. */
  @media screen and (min-width: 960px) {


    body .site {
        padding: 0 40px;
        padding: 0 2.857142857rem;
        margin-top: 48px;
        margin-top: 3.428571429rem;
        margin-bottom: 48px;
        margin-bottom: 3.428571429rem;
        box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3);



Edit: Here is a style.css for a child theme:

Theme Name:     Twenty Twelve Child
Theme URI:      http: //example.com/
Description:    Child theme for the Twenty Twelve theme
Author:         birgire
Template:       twentytwelve
Version:        1.0

@import url("../twentytwelve/style.css");

Custom page layout

/* remove site margin */
body .site{margin:0;max-width: 100%;}
  • Thank you for the answer. Should I make a child theme to safely apply this CSS? Feb 11, 2013 at 16:49
  • yes, I recommend it.
    – birgire
    Feb 11, 2013 at 16:53
  • Sorry, but it didn't help. I've created a child theme: @import url("../twentytwelve/style.css"); and after that pasted those definitions. The margins are still here. Feb 11, 2013 at 17:06
  • I added the style.css above for the child theme.
    – birgire
    Feb 11, 2013 at 17:22
  • Brilliant! Thank you very much! This is exactly what I was looking for. One more (small) question please. How to change width of main content and sidebar in percents (I want to reduce sidebar width)? Feb 11, 2013 at 17:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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