nielcleo Posted October 1, 2010 Share Posted October 1, 2010 i try to search and read articles about links hover and i still not found the right thing.rather than image tricks im searching alternative for a link hover that have a background on link what you have stayed.for examplei click Home and im in home page the link home have a background image. and when i click contact us the link contact us have a background imageguys can you give me idea?thanks in advance. Link to comment Share on other sites More sharing options...
wirehopper Posted October 1, 2010 Share Posted October 1, 2010 Active? http://www.w3schools.com/Css/pr_pseudo_active.asp Link to comment Share on other sites More sharing options...
trevelluk Posted October 1, 2010 Share Posted October 1, 2010 If I'm reading your question properly, then what you're asking for is for the link for the page you are currently on to be different from the other links.Unfortunately then it isn't possible to directly do something like this in CSS, but what you can do is add an extra or alternative class to the link for the page you are on, and set up some styling based on this. Link to comment Share on other sites More sharing options...
thescientist Posted October 1, 2010 Share Posted October 1, 2010 If I'm reading your question properly, then what you're asking for is for the link for the page you are currently on to be different from the other links.Unfortunately then it isn't possible to directly do something like this in CSS, but what you can do is add an extra or alternative class to the link for the page you are on, and set up some styling based on this.uh, did you look at wirehoppers link? Link to comment Share on other sites More sharing options...
dsonesuk Posted October 1, 2010 Share Posted October 1, 2010 :active does not not always work as you would expect, depending on browser. that's why with adding the class for active state, you force it to change to the styling you require, in your design. Link to comment Share on other sites More sharing options...
ShadowMage Posted October 1, 2010 Share Posted October 1, 2010 uh, did you look at wirehoppers link?Yeah, but that only works if the link is selected. When it loses focus, those styles no longer apply. Link to comment Share on other sites More sharing options...
nielcleo Posted October 2, 2010 Author Share Posted October 2, 2010 i tried the link of wirehopper its working but the code gives only the hover of but when i try to click it the style is gone. Unfortunately then it isn't possible to directly do something like this in CSS, but what you can do is add an extra or alternative class to the link for the page you are on, and set up some styling based on this.sir trevelluk im getting your point i imagine how to do that can you give me example? thanks for that sir. Link to comment Share on other sites More sharing options...
dsonesuk Posted October 2, 2010 Share Posted October 2, 2010 .active {background: url (mybgimage.jpg) no-repeat; display:block; width:100px; height: 25px;}on Home page<a class="active" href="index.php">Home</a>on Contact Us<a class="active" href="contactus.php">Contact Us</a> Link to comment Share on other sites More sharing options...
nielcleo Posted October 4, 2010 Author Share Posted October 4, 2010 .active {background: url (mybgimage.jpg) no-repeat; display:block; width:100px; height: 25px;}on Home page<a class="active" href="index.php">Home</a>on Contact Us<a class="active" href="contactus.php">Contact Us</a>thanks thanks sir Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.