homepage Welcome to WebmasterWorld Guest from 54.204.249.184
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Making a link inactive?
How to make a link appear the same in style as other links, but be inactive
MTKilpatrick




msg:608463
 11:44 am on Jul 11, 2003 (gmt 0)

Folks,

I'm working on a dynamic menu (created with PHP) and using CSS to define the styles, but there's a question that may probably be pure HTML, suited to this forum.

I'm making my menu such that the menu link for the current displayed page is to become inactive, so that users don't waste bandwidth accidentally reloading the same page. I would like the link to appear in a different colour also to indicate clearly that this is the menu item being displayed in the content area of the page.

What is the best way to define the menu item? One way is to change the link from:

<a href="thispage.html">This Menu Item</a>

to

<a class="red_highlighted" >This Menu Item</a>

Because removing the href attribute renders the link inactive, and I can define a CSS class to give a different colour, hover, etc.

The other way is simply to change the link to something else:

<h1 class="red_highlighted">......

Is there a prefered solution? Is there a solution which allows the menu item to look more like a link - in so far as the mouse pointer will still change to the hand icon when hovering over the inactive link? If I use either of the two methods above, the mouse icon does not change to the hand when over the inactivated link/h1. So, can one create a link with the appropriate mouse hover icon but with no link activity?

thanks,

Michael

 

BlobFisk




msg:608464
 11:55 am on Jul 11, 2003 (gmt 0)

I think that if you want the link to be in inactive, remove the <a>nchor from it altogether. As for styling it, why not just emphasise it to flag that this is the currently selected/active page?

DaveN




msg:608465
 11:57 am on Jul 11, 2003 (gmt 0)

You need to set your CSS to change these values.

a:link
a:visited
a:hover
a:active

Dave

g1smd




msg:608466
 10:27 pm on Jul 11, 2003 (gmt 0)

>> <a class="red_highlighted"> <<

You should choose names based on what it does, not what it looks like!

If you wanted that "link" in green next week, then the code saying class="red" is just going to be confusing.

Change it to something like class="linkdisabled" or something.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved