Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question
    
This is a pure CSS question and as such is off-topic per the faq –  s_ha_dum Feb 11 '13 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.) –  Sergey Brunov Feb 11 '13 at 17:01

1 Answer 1

up vote 2 down vote accepted

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

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

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

    ...cut...

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

    ...cut...

    }


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

    ...cut...

    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);
    }

    ...cut...

}

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%;}
share|improve this answer
    
Thank you for the answer. Should I make a child theme to safely apply this CSS? –  Sergey Brunov Feb 11 '13 at 16:49
    
yes, I recommend it. –  birgire Feb 11 '13 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. –  Sergey Brunov Feb 11 '13 at 17:06
    
I added the style.css above for the child theme. –  birgire Feb 11 '13 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)? –  Sergey Brunov Feb 11 '13 at 17:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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