Archived

This topic is now archived and is closed to further replies.

  • 0

Resolved CSS selector for Child Pages

Question

Posted · Report post

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

Share this post


Link to post
Share on other sites

7 answers to this question

Posted · Report post

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)

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

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

<body class="page page-id-96 page-child parent-pageid-2 page-template page-template-page-epsilon-php logged-in admin-bar custom responsive pagelines-template-theme epsilon full_width ">[/CODE]

You can use [b]page-child parent-pageid-2[/b] to target your child pages.

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post


.parent-pageid-35 #content .content-pad {
padding-top: 0!important;
}
[/CODE]

Dont forget the closing brace, should work tho

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

The topic was marked as resolved.

Share this post


Link to post
Share on other sites