Title: CSS/padding on specific pages
Last modified: February 27, 2023

---

# CSS/padding on specific pages

 *  Resolved [samovaari](https://wordpress.org/support/users/samovaari/)
 * (@samovaari)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/css-padding-on-specific-pages/)
 * Hi, we are trying to make sure the homepage is full width but the sub pages like
   Terms & Conditions, FAQ, Woocommerce pages like Cart and Checkout etc have some
   padding, because the text is touching the sides of the screens and is difficult
   to read on these pages. To make it a bit more complicated even, the project page
   needs to be full width as well so we would need to exclude this from having padding
   as well as the homepage.
 * Tried in multiple different ways, most recently with this but it affected everything
   including the footer and we’re not sure how to start excluding other pages from
   this rule.
 * `.site-main .wrapper {
   padding: 40px 40px;}
 * Any ideas how to go about this?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcss-padding-on-specific-pages%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [Muhammad Jawad Abbasi](https://wordpress.org/support/users/jawad1234/)
 * (@jawad1234)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/css-padding-on-specific-pages/#post-16509475)
 * Open any page for example this one [https://staging.orballo.eu/faq/](https://staging.orballo.eu/faq/)
   then press Ctrl+U and find page-id please see in the screenshot [https://ibb.co/0BNjc4f](https://ibb.co/0BNjc4f)
 * then copy “page-id-39” then go Appearance->Customize->Additional CSS option then
   paste “page-id-39” and then you will enter “#main”
 * .page-id-39 #main{
   padding: 40px 40px;}
 * so now your FAQ page padding implement it so for other pages simply you open 
   the page and search that like in screenshot [https://ibb.co/0BNjc4f](https://ibb.co/0BNjc4f)
 * copy and paste on Additional CSS just you will add #main
 * **For Multiple pages code apply like that**
 * .page-id-39 #main, .page-id-41 #main{
    padding: 40px 40px;}
 *  [Muhammad Jawad Abbasi](https://wordpress.org/support/users/jawad1234/)
 * (@jawad1234)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/css-padding-on-specific-pages/#post-16509718)
 * if that not work then padding put like that padding: 40px 40px !important;
 *  [George Appiah](https://wordpress.org/support/users/gappiah/)
 * (@gappiah)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/css-padding-on-specific-pages/#post-16511583)
 * I hope both of you don’t mind me chiming in 😀
 * While Muhammad’s suggestion should work in principle, I don’t consider it a practical
   solution. That’s because you’ll have to add the ID of every single page (and 
   post) you create to your CSS, and this will very quickly become untenable.
 * **If you’re sure you want to apply this padding to ALL pages except the homepage
   alone** (or a handful of pages), then use the following instead… so you don’t
   have to track down the IDs of all future.
 *     ```
       #main {
           padding: 40px;
       }
       .home #main {
           padding: 0;
       }
       ```
   
 * The first part adds the padding of 40px everywhere, while the second part removes
   this padding for the homepage only. Note that since your desired padding is 40px
   for all sides, I’ve used the CSS shorthand to combine the `40px 40px` to a single`
   40px`.
 * Good luck!
 *  [Muhammad Jawad Abbasi](https://wordpress.org/support/users/jawad1234/)
 * (@jawad1234)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/css-padding-on-specific-pages/#post-16512383)
 * [@gappiah](https://wordpress.org/support/users/gappiah/) you are right, thank
   you
 *  Thread Starter [samovaari](https://wordpress.org/support/users/samovaari/)
 * (@samovaari)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/css-padding-on-specific-pages/#post-16515038)
 * Thank you [@jawad1234](https://wordpress.org/support/users/jawad1234/) and [@gappiah](https://wordpress.org/support/users/gappiah/)
   for your input! Worked like a charm!

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

The topic ‘CSS/padding on specific pages’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 3 participants
 * Last reply from: [samovaari](https://wordpress.org/support/users/samovaari/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/css-padding-on-specific-pages/#post-16515038)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
