css active menu to be highlighted...

Hello, I am working on the HTML/css code shown below. When I select a menu I would like the underline color to stay different till I select the next menu item. How can I do this?

/****CSS for the top menu***/
font-weight: bold;
width: 100%;
.underlinemenu ul{
padding: 16px 0 7px 0; /*6px should equal top padding of "ul li a" below, 7px should equal bottom padding + bottom border of "ul li a" below*/
margin: 0;
text-align: center; //set value to "left", "center", or "right"*/
.underlinemenu ul li{
display: inline;
.underlinemenu ul li a{
color: #494949;
padding: 6px 3px 4px 3px; /*top padding is 6px, bottom padding is 4px*/
margin-right: 20px; /*spacing between each menu link*/
text-decoration: none;
border-bottom: 3px solid gray; /*bottom border is 3px*/
.underlinemenu ul li a:hover, .underlinemenu ul li a.selected {
border-bottom-color:#f9a63f ;

/*****End CSS Menu ***/

Open in new window

<div class="underlinemenu">
<li><a href="companyInfo.php">Company </a></li>
<li><a href="branchInfo.php">Branch </a></li>
<li><a href="branch_store.php">Store</a></li>

Open in new window

Thanks for the help.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Steve BinkCommented:
Try targeting the :active or :focus pseudo-classes:
.underlinemenu ul li a:hover, .underlinemenu ul li a.selected, .underlinemenu ul li a:focus, .underlinemenu ul li a:active {
border-bottom-color:#f9a63f ;

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Move pseudo-class :hover to li element, like here:
.underlinemenu ul li:hover a, .underlinemenu ul li a.selected {
border-bottom-color:#f9a63f ;

Open in new window

aej1973Author Commented:
Thank you.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.