I have structured my HTML as follows:
<div id="chromemenu" class="chromestyle">
<ul>
<li><a rel="dropmenu1" href="#" class="">Buy</a></li>
<li><a rel="dropmenu2" href="#" class="">Sell</a></li>
<li><a rel="dropmenu3" href="#" class="">Community</a></li>
<li><a rel="dropmenu6" href="#" class="">Languages</a></li>
<li><a rel="dropmenu4" href="#" class="">My Account</a></li>
</ul>
</div>
With the help of jQuery
, I added a selected class when a user hovers over a link (for example, the Buy link) in the menu. This changes the markup to:
<div id="chromemenu" class="chromestyle">
<ul>
<li><a rel="dropmenu1" href="#" class="selected">Buy</a></li>
<li><a rel="dropmenu2" href="#" class="">Sell</a></li>
<li><a rel="dropmenu3" href="#" class="">Community</a></li>
<li><a rel="dropmenu6" href="#" class="">Languages</a></li>
<li><a rel="dropmenu4" href="#" class="">My Account</a></li>
</ul>
</div>
Now, I am looking for a way to style only the li
elements that contain an a
element with a selected class. Specifically, I want to add a border to these li
elements. Any suggestions on how to achieve this using CSS? Your help is greatly appreciated. Thank you.
Update:
I need to apply the border to the li
element itself, not the nested a
element. Is there a simple CSS solution for this? Still awaiting your response...