Current location: Hot Scripts Forums » General Web Coding » CSS » Link BG colors


Link BG colors

Reply
  #1 (permalink)  
Old 11-09-04, 02:23 PM
doveroh doveroh is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Link BG colors

Is there a way to make a link background color change only for certain links on the web site? I have only found ways to make all the links change to show a background when the mouse hovers over it, and I only want it to happen when its over my menu.

Thanks,
Jesse Moran
Reply With Quote
  #2 (permalink)  
Old 11-09-04, 04:12 PM
stuboo stuboo is offline
New Member
 
Join Date: Nov 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Jesse,

Give your menu a specific class/id and use the :hover pseudo-class to make it happen. If you use class="menu" to identify your menu, your CSS will look something like this . . .

Code:
a.menu:hover {
     background-image: url(http://www.yoursite.com/yourimage.gif);
     }
If you use id="menu" it will look like this . . .
Code:
a#menu:hover {
     background-image: url(http://www.yoursite.com/yourimage.gif);
     }
I'm no CSS guru myself but I think this is the correct code to do what you want to do.

Hope this helps.

stuboo

Last edited by stuboo; 11-09-04 at 04:56 PM.
Reply With Quote
  #3 (permalink)  
Old 11-19-04, 03:48 PM
junkie_xl's Avatar
junkie_xl junkie_xl is offline
Newbie Coder
 
Join Date: Apr 2004
Location: Birkerød, Denmark
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
you're almost right, but if it is the background color that is supposed to be changed, the code i like this:

a.menu {
background-color: #ffffff;
}

a.menu:hover {
background-color: #f1f1f1;
}
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Webmaster Link Exchanges epic1231 General Advertisements 0 08-28-04 04:46 PM
how to link to insert pages samkry ASP 0 06-13-04 11:14 PM
$ in http:// link via email? GG Dart PHP 2 01-15-04 11:23 AM
Passing a table or variable through a link? chinablack1480 PHP 1 12-07-03 03:55 AM
Different type of link counter mdhall Script Requests 2 10-10-03 01:19 PM


All times are GMT -5. The time now is 01:34 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.