473,385 Members | 1,843 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Adding a link to a hover

I have a background image within a div. When I hover over it, it goes from black&white to color. Now all I need to do, is figure out to link it to a website. I want, when hovered/turns to color - for it people to click on it and it take them to a different website.



Here's my CSS code:

Expand|Select|Wrap|Line Numbers
  1. #color {
  2.     display: block;
  3.     background: url(../img/color.gif)blue;
  4.     position: absolute;
  5.     width: 304px;
  6.     height: 313px;
  7.     margin-left: -150px;
  8.     margin-top: 200px;
  9.     z-index: -100;
  10. }
  11.  
  12. #color:hover {
  13.     background-position: 0 -313px;
  14. }
  15.  
  16. #color span {
  17.   display: none;
  18. }
Apr 17 '10 #1
1 1574
Use onclick on the div

Expand|Select|Wrap|Line Numbers
  1. onclick="location.href=http://whatever'"
Hope this answers your question
Apr 18 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: LRW | last post by:
Below I'll paste my CSS and the HTML in question. But what's happening is, I'm trying to establish a link behavior for a class that's separate from the normal link class. I've established a: 's...
12
by: jfburr | last post by:
very simple thing (I hope) I've got a css style sheet that starts like this: ______________ A:link { color: cc9933; }
33
by: Thomas Mlynarczyk | last post by:
Hi, I'm looking for a way to put a 1px solid border around the image in this link: <a href="some.html"><img src="some.gif"></a> Well, that, by itself, is simple. However, I would like to have a...
7
by: Jamie | last post by:
Hi everyone, Meyer on p. 91 of "Eric Meyer on CSS" says that link styles must be added in LVHA order (link, visited, hover, active) or link styles will stop working. Why is that? Is there an...
6
by: SeaPlusPlus | last post by:
I've got a problem... IE 6.0 twitches when I hover over a link then it won't twitch again for that group of links but will twitch the first time on the next group... and the next group... etc... ...
5
by: Papa.Legba.666 | last post by:
I am a total lamer clueless stupid newbie (so please flame me). Honestly, I know nothing of CSS, although I tend to pick things up quickly... A friend pointed out that my JavaScript menu...
29
by: jmaxsherkimer | last post by:
the site we're working on has some anchor links, you click them they scroll to the bottom of the page with the answers to the questions linked on to. is there anyway to make it so that the links...
9
by: Richard | last post by:
Please hlep with a very frustrating problem. I need to be able to have a reference to my "btcopyrights" CSS class override the link colors first specified earlier in the CSS. I inherited a large...
8
by: maya | last post by:
I have some links.. http://www.francesdelrio.com/linksCSS.html want it so when you hover over link ENTIRE DIV gets gray bg color (not just text (like link Three is now on this page..) but...
7
by: fredo | last post by:
I've studied Eric Meyer's pure css popups, version two: http://meyerweb.com/eric/css/edge/popups/demo2.html which pops up an image when I roll over a text link. Now I want to pop up a large...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.