Jump to content

Change color of nav menu on current page


yandoo

Recommended Posts

Hiya I was wondering how I can edit my nav menu so that nav menu for the current page changes:

 

I just want it so it is the same as when it is hovered over but i just cant seem to work out how to implement it. If I create a new class and assign it to the nav menu manually and I can change the font color but not the background color or border?

 

<li class="selected">My Travels</li>

 

Any ideas?

 

Thank you

#nav, .nav, #nav .nav li { margin:0px; padding:0px; font-family: Arial; font-weight:600;}
#nav li {float:left; display:inline; cursor:pointer; list-style:none; padding:5px 20px 5px 20px;border-radius:10px; position:relative; 	background: rgba( 0,0,0, 0.7);border:1px solid #FDD017;margin-left:5px;}
#nav li ul.first {left:-1px; top:100%;}

li, li a {color:#FDD017; text-decoration:none; font-size:16px}
#nav .nav li { width:100%; text-indent:10px; line-height:30px; margin-right:10px; border-top:1px #000 solid;  
border-left:none; border-right:none; background:#757547;}
#nav li a {display:block; width:inherit; height:inherit;}

ul.nav { display:none; }
#nav li:hover > a, #nav li:hover { color:#000; background:#FDD017; }
li:hover > .nav { display:block; position:absolute; width:250px; top:-2px; left:50%; z-index:1000; border:1px #000 solid; } 
li:hover { position:relative; z-index:2000; } 
Edited by yandoo
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.