Title: CSS child coding not working
Last modified: August 20, 2016

---

# CSS child coding not working

 *  Resolved [benetmc](https://wordpress.org/support/users/benetmc/)
 * (@benetmc)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/css-child-coding-not-working/)
 * Hello,
 * I am looking to make what I thought were basic changes to my background in the
   2012 theme (only on one page but I will try and deal with that issue later)
 * In my parent css if I change this code
 *     ```
       /* Page structure */
       .site {
       	padding: 0 24px;
       	padding: 0 1.714285714rem;
       	background-color: #fff;
       }
       ```
   
 * Then the background colour changes as expected. I assumed that if I copied this
   section to my child .css and changed the colour then it would work but it has
   not.
 * Any ideas what I am doing wrong?
    Ben

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

 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/css-child-coding-not-working/#post-3579035)
 * Hard to say without looking at the site live – can you post a link to it?
 *  Thread Starter [benetmc](https://wordpress.org/support/users/benetmc/)
 * (@benetmc)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/css-child-coding-not-working/#post-3579036)
 * Hi yogi,
 * Thanks for getting back to me. It is very much under development but this is 
   a link to the site page
 * [http://alwaysremembered.org/christophermcmanus/stories/](http://alwaysremembered.org/christophermcmanus/stories/)
 * In the adult css is written
 *     ```
       /* Page structure */
       .site {
       	padding: 0 24px;
       	padding: 0 1.714285714rem;
       	background-color: #fff;
       }
       ```
   
 * as mentioned above, on line 509. I have changed the background-colour and got
   the right results so I thought that by pasting this into my child css file
 *     ```
       body {
       /* Page structure */
       .site {
       	padding: 0 24px;
       	padding: 0 1.714285714rem;
       	background-color: #001a35 !important;
       }
       ```
   
 * I would get the same results
 *  Thread Starter [benetmc](https://wordpress.org/support/users/benetmc/)
 * (@benetmc)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/css-child-coding-not-working/#post-3579037)
 * Sorry, don’t know where that ‘body {‘ came from, an earlier attempted fix I think
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/css-child-coding-not-working/#post-3579038)
 * the commenting section of the body format is not properly closed;
 * should be:
 *     ```
       body {
       /* border: 10px solid red !important;
        background-colour: #000000 important; */
       }
   
       /* Page structure */
       .site {
       	padding: 0 24px;
       	padding: 0 1.714285714rem;
       	background-color: #001a35 !important;
       }
       ```
   
 *  Thread Starter [benetmc](https://wordpress.org/support/users/benetmc/)
 * (@benetmc)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/css-child-coding-not-working/#post-3579039)
 * …and after removing that it has finally worked.
 * Now I need to only make it apply to one page, bit cheeky to ask a second question
   but is there any way to get css to only apply to one template file?
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/css-child-coding-not-working/#post-3579040)
 * > apply to one page
 * if you are referring to a static page, find the page ID of that page, and use
   it this way:
 * `.page-id-123 .site { background: #123edf; }`
 * `.page-id-123` is one of the various outputs of page (web page) specific css 
   classes;
 * review [http://codex.wordpress.org/Function_Reference/body_class](http://codex.wordpress.org/Function_Reference/body_class)
 *  Thread Starter [benetmc](https://wordpress.org/support/users/benetmc/)
 * (@benetmc)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/css-child-coding-not-working/#post-3579043)
 * Thanks for all the help, I will try it that way
 * You guys are why WordPress is so F’in awesome.
    B

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

The topic ‘CSS child coding not working’ is closed to new replies.

## Tags

 * [2012 theme](https://wordpress.org/support/topic-tag/2012-theme/)
 * [child css](https://wordpress.org/support/topic-tag/child-css/)

 * 7 replies
 * 3 participants
 * Last reply from: [benetmc](https://wordpress.org/support/users/benetmc/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/css-child-coding-not-working/#post-3579043)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
