• Resolved benetmc

    (@benetmc)


    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)
  • Hard to say without looking at the site live – can you post a link to it?

    Thread Starter benetmc

    (@benetmc)

    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/

    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

    (@benetmc)

    Sorry, don’t know where that ‘body {‘ came from, an earlier attempted fix I think

    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

    (@benetmc)

    …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?

    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

    Thread Starter benetmc

    (@benetmc)

    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.