How to set the selection to the parent so that child elements are not allocated?

There is a menu. It is the parent li element, which you want to set the selection when it's active. to child elements do not stand out. Here is my code:
<li <? if($_request["parent_menu"]="=2){echo" 'class="active_content" ';}?>><a href="../content/index.php?parent_menu=2" class="btn-content">Content</a>
 <ul class="sidenav_new_content">
 <li <?="$fname=="leads"?'class="active"':";?">><a href="../leads/index.php?parent_menu=2" class="btn-leads">Leads</a></li>
</ul>
</li>
September 26th 19 at 06:52
2 answers
September 26th 19 at 06:54
.active_content { your styles.}
he is always active and you need only when you click on a parent myself, and when you click on the child were a child. in this case, that You wrote the parent is always highlighted even when you click on a child - maiya_Metz commented on September 26th 19 at 06:57
About click you wrote nothing in the description. Click you have done on A most likely, you have a button - btn-leads and btn-content, so when you click on them toggle the class active, and styles write .btn-leads.active {} and .btn-content.active {} - Brain.MacGyver commented on September 26th 19 at 07:00
wrote, but did not succeed. for the answer thank you very much!!! was told to change the design - maiya_Metz commented on September 26th 19 at 07:03
to remove the activity of the parent is impossible, because there will be a drop-down menu - maiya_Metz commented on September 26th 19 at 07:06
The original solution =)) - Brain.MacGyver commented on September 26th 19 at 07:09
What you will not do =)) display design, and I'll tell you How )) - Brain.MacGyver commented on September 26th 19 at 07:12
September 26th 19 at 06:56
we must also know what to the parent unit markings for example if to it Internet div and class .menu then the div > .menu > li > a {color: red;} or div > .menu > active_content > a {color: red;}
active_content > a {color: red;} - and it simply will not work? - maiya_Metz commented on September 26th 19 at 06:59
will) - Brain.MacGyver commented on September 26th 19 at 07:02

Find more questions by tags CSS