Highlighting the active link

This is a discussion on "Highlighting the active link" within the Web Page Design section. This forum, and the thread "Highlighting the active link are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Mar 3rd, 2008, 15:54
Junior Member
Join Date: May 2006
Location: UK
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Question Highlighting the active link

Hi

I would like the active link on a menu to remain highlighted while the user remains on that link i.e. page (so the user can see what page they are visiting without me having to put an extra heading onto that page), so I was disappointed to find that a:active doesn't actually do this, despite its name! (Hope all that makes sense).

Is there an easy way to do this?

Thanks
Lynn
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Mar 3rd, 2008, 16:21
Aso's Avatar
Aso Aso is offline
Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,339
Blog Entries: 2
Thanks: 11
Thanked 49 Times in 46 Posts
Re: Highlighting the active link

a:active is for links currently active (i.e clicked on) on the current page.

It would be impossible for CSS to *know* which page you were on!

You'll need to hard code an extra class to the 'current' link for each page, or dynamically insert it if you're using a CMS.

Something like
Code: Select all
<a href="about" class="active">About</a>
Then in your CSS, apply the styles for your selected link like so
Code: Select all
.active {
/*Current page link styles*/
}
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Mar 3rd, 2008, 16:48
unitedcraig's Avatar
SuperMember

SuperMember
Join Date: Oct 2007
Location: Stockport
Age: 17
Posts: 844
Blog Entries: 1
Thanks: 0
Thanked 1 Time in 1 Post
Re: Highlighting the active link

This question has been posted, i think the post will help

http://www.webforumz.com/css-forum/6...rrent-page.htm

In future searching for your question in the forum can be easier than asking it again mate
__________________
Last Blog Entry: A Royal Mistake (Feb 20th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Mar 3rd, 2008, 18:24
Aso's Avatar
Aso Aso is offline
Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,339
Blog Entries: 2
Thanks: 11
Thanked 49 Times in 46 Posts
Re: Highlighting the active link

I knew that post was somewhere! Cheers unitedcraig
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Mar 3rd, 2008, 19:14
Junior Member
Join Date: May 2006
Location: UK
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Highlighting the active link

Got it working, thanks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Highlighting text selections mikemike2004 JavaScript Forum 6 Mar 15th, 2008 21:24
a:link, active, hover, visited.... mcdanielnc89 Web Page Design 35 Nov 8th, 2007 22:10
Window Highlighting problem in JavaScript jayaramgussy JavaScript Forum 5 Sep 20th, 2007 13:01
How do I get people active and keep them active? TheSealPortalTeam Webforumz Cafe 4 May 9th, 2007 10:17
Highlighting Text bovverboi Web Page Design 4 Nov 5th, 2006 11:36


All times are GMT. The time now is 23:31.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42