Jump to content


Photo
- - - - -
Resolved

CSS selector for Child Pages



This topic has been archived. This means that you cannot reply to this topic.
7 replies to this topic

#1 wendygordon

wendygordon

    Super Member

  • Members

  • 156 posts

Posted 12 September 2012 - 06:50 PM

I have changed the padding on a parent page using this css:

.page-id-35 #content .content-pad {
padding-top: 0px!important;
}

I would like all of the child pages of ONLY this page to have the same padding.

what is the correct Css to do that?

thanks as always.
Wendy

#2 catrina

catrina

    Advocate

  • Members
  • 12345 posts

Posted 12 September 2012 - 07:03 PM

Child pages have their own page ID numbers, so you'll need to use them in the same CSS code. (Just copy the CSS code and replace the page ID numbers in the selectors)

#3 wendygordon

wendygordon

    Super Member

  • Members

  • 156 posts

Posted 12 September 2012 - 07:28 PM

Hey Catrina -i was hoping not to have to name each child. There is no way I could say "all childs of page-35?"

#4 catrina

catrina

    Advocate

  • Members
  • 12345 posts

Posted 12 September 2012 - 07:52 PM

A developer just informed that there is a way to target child pages. If you look here at the body tag:

Please Login or Register to see this Hidden Content


You can use page-child parent-pageid-2 to target your child pages.

#5 wendygordon

wendygordon

    Super Member

  • Members

  • 156 posts

Posted 12 September 2012 - 08:09 PM

yes. thanks. I did see that, but at first I couldnt figure out what i needed

can you please confirm that this is correct and will work for all the child pages of page 35?


.parent-pageid-35 #content .content-pad {
padding-top: 0!important;

thanks so much.
Wendy

#6 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts

Posted 12 September 2012 - 08:19 PM

Please Login or Register to see this Hidden Content

Dont forget the closing brace, should work tho

#7 wendygordon

wendygordon

    Super Member

  • Members

  • 156 posts

Posted 12 September 2012 - 09:15 PM

thanks. yes. i was just copying and pasting badly! thanks so much pross!

#8 James B

James B

    Advocate

  • Members

  • 5126 posts

Posted 12 September 2012 - 09:20 PM

The topic was marked as resolved.