am having a menu with five elements all under div’s with same class.
onclick of a selected menu ( div) i want to make the font-weight of selected to bold.
for that i used .classname a:active{font-weight:Bold}.
this will make menu -item bold on active,but only on click, but it gets again normal when mouse click event ends.
But i need to make the menu-item bold until the user clicks on another menu-item.
howz it possible.
menu structre.
<div class="coolmenu">
<a>menu1</a>
</div> <div class="coolmenu">
<a>menu2</a>
</div>
On click first you have to set font-weight to normal for all menu elements and then set bold only for clicked one, something like this:
Maybe it will better if you use
addClassinsteadcss, it will give you more flexibility.