Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Current/Active Page Link Properties
Old 06-18-2008, 12:44 PM Current/Active Page Link Properties
efru's Avatar
Average Talker

Posts: 16
Trades: 0
Is there a way CSS method of giving properties to links that are currently being viewed/active?

For example, if I'm on index.php, and there's a link on the page that links to index.php, is there a way to give that link properties so that it's a different color/italic/etc?

Up until this point I've been using PHP to check the PHP_SELF value and then put 'if' statements into the <a> tag, which seems like sort of a hack job.

Thanks
efru is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-18-2008, 12:53 PM Re: Current/Active Page Link Properties
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
One method is to define a new CLASS to be applied to the link. Define whatever changes you want for that 'current' link. An example would be changing the background color:

.current{background: #d6b7e5; font-style: oblique;}

HTML would then be:
<a class="current" href="#">Photo gallery<a>
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 06-18-2008, 01:07 PM Re: Current/Active Page Link Properties
efru's Avatar
Average Talker

Posts: 16
Trades: 0
Right, that's basically what I'm doing now. It just seems to me like an old technique, given the enormous power of CSS.

I wish the pseudo:active class would compare the current document you're looking at with the link in the <a> tag. Oh well.
efru is offline
Reply With Quote
View Public Profile
 
Old 06-18-2008, 02:50 PM Re: Current/Active Page Link Properties
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
It may be 'old', but it works every time
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 06-22-2008, 07:38 PM Re: Current/Active Page Link Properties
efru's Avatar
Average Talker

Posts: 16
Trades: 0
Thanks Lady
__________________

Please login or register to view this content. Registration is FREE
efru is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Current/Active Page Link Properties
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.52348 seconds with 12 queries