Title: restrict container width without changing mobile layout
Last modified: August 22, 2016

---

# restrict container width without changing mobile layout

 *  Resolved [Allen Farmelo](https://wordpress.org/support/users/allen-farmelo/)
 * (@allen-farmelo)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/restrict-container-width-without-changing-mobile-layout/)
 * Hi,
 * I want to restrict my container width, but when I do the mobile version also 
   changes.
 * Specifically, setting the container width makes the mobile app use the same width,
   which is no good for mobile phones.
 * Also, when I set a padding on the right hand so there’s space between the body
   text and the sidebar, it does that on the phone too.
 * I’m using these codes:
 * .container {
    width: 1024px; }
 * .main.col-lg-9 {
    padding-right: 100px; }
 * Is there a way to tell the main version what to do without affecting what happens
   on the mobile version?
 * website is: [http://www.pinknoisemag.com](http://www.pinknoisemag.com)
 * Thanks!
    Allen

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [hannah](https://wordpress.org/support/users/hannahritner/)
 * (@hannahritner)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/restrict-container-width-without-changing-mobile-layout/#post-5511125)
 * Hey, you can use media queries. So you could try adding this:
 *     ```
       @media (min-width: 1024px) {
       .container {
       width: 1024px;
       }
       .main.col-lg-9 {
       padding-right: 100px;
       }
       }
       ```
   
 * Hannah
 *  Thread Starter [Allen Farmelo](https://wordpress.org/support/users/allen-farmelo/)
 * (@allen-farmelo)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/restrict-container-width-without-changing-mobile-layout/#post-5511296)
 * Hannah, thank you! That’s working.
 * One quirk – this now puts the date square back into the mobile posts, as well
   as the posting date at the top, which I had eliminated with this code:
 * .post .subhead,
    .postdate { display: none; }
 * Thoughts?
 *  [Ben Ritner – Kadence WP](https://wordpress.org/support/users/britner/)
 * (@britner)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/restrict-container-width-without-changing-mobile-layout/#post-5511297)
 * See how hannahs css has two closing brackets at the end… one for the css one 
   for the media query. Yours doesn’t have the two that are needed.
 * Kadence Themes
 *  Thread Starter [Allen Farmelo](https://wordpress.org/support/users/allen-farmelo/)
 * (@allen-farmelo)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/restrict-container-width-without-changing-mobile-layout/#post-5511304)
 * Thank you so much! Works perfectly!
 * Allen

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘restrict container width without changing mobile layout’ is closed to
new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/virtue/3.4.15/screenshot.png)
 * Virtue
 * [Support Threads](https://wordpress.org/support/theme/virtue/)
 * [Active Topics](https://wordpress.org/support/theme/virtue/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/virtue/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/virtue/reviews/)

## Tags

 * [container](https://wordpress.org/support/topic-tag/container/)
 * [mobile](https://wordpress.org/support/topic-tag/mobile/)
 * [padding](https://wordpress.org/support/topic-tag/padding/)
 * [width](https://wordpress.org/support/topic-tag/width/)

 * 4 replies
 * 3 participants
 * Last reply from: [Allen Farmelo](https://wordpress.org/support/users/allen-farmelo/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/restrict-container-width-without-changing-mobile-layout/#post-5511304)
 * Status: resolved