Home › Forums › Back End › [Solved] WordPress – Pages/Sub Pages Menu Question › Re: [Solved] WordPress – Pages/Sub Pages Menu Question
November 9, 2009 at 9:15 am
#66401
Participant
"TeMc" wrote:
Oh, you want the childpages to appear within the menu.
Yes thats is just what I want to do. :)
Using very basic php code:
Code:
My original CSS (based on Chris’ webcast example) was:
Code:
#main-nav { list-style: none; padding: 25px 0 40px 0; }
#main-nav li { font: 20px Georgia, serif; }
#main-nav li a { color: #060; display: block; padding: 3px 0; }
#main-nav li a:hover{ color: #FFF; }
#main-nav li.current_page_item a { background: #01a710; background: rgba(1,167,16,1); margin: 0 0 0 -20px; text-indent: 20px; color: #FFF; -moz-border-radius-topright: 10px; -moz-border-radius-bottomright: 10px; -webkit-border-top-right-radius: 10px; -webkit-border-bottom-right-radius: 10px; border-radius: 20px; }
#main-nav li { font: 20px Georgia, serif; }
#main-nav li a { color: #060; display: block; padding: 3px 0; }
#main-nav li a:hover{ color: #FFF; }
#main-nav li.current_page_item a { background: #01a710; background: rgba(1,167,16,1); margin: 0 0 0 -20px; text-indent: 20px; color: #FFF; -moz-border-radius-topright: 10px; -moz-border-radius-bottomright: 10px; -webkit-border-top-right-radius: 10px; -webkit-border-bottom-right-radius: 10px; border-radius: 20px; }
I have now added from TeMc’s example:
Code:
#main-nav li ul { display:none;}
#main-nav li.current_page_item ul,
#main-nav li.current_page_parent ul,
#main-nav li.current_page_ancestor ul { display: block; }
#main-nav li.current_page_item ul,
#main-nav li.current_page_parent ul,
#main-nav li.current_page_ancestor ul { display: block; }
The menu text is now 100% correct, but formatting is not right and here I struggle. The child items are displayed within the list item of their parent and I do not see whete I can apply css to these sub-levels of the menu.
For example:
Any ideas how I apply different css to the child pages of the selected parent?