Adding a link to a hover

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wtlemon
    New Member
    • Apr 2010
    • 1

    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:

    Code:
    #color {
    	display: block;
    	background: url(../img/color.gif)blue;
    	position: absolute;
    	width: 304px;
    	height: 313px;
    	margin-left: -150px;
    	margin-top: 200px;
    	z-index: -100;
    }
    
    #color:hover {
    	background-position: 0 -313px;
    }
    
    #color span {
      display: none;
    }
    Last edited by Dormilich; Apr 17 '10, 09:56 PM. Reason: Please use [code] tags when posting code
  • easyjizz
    New Member
    • Apr 2010
    • 3

    #2
    Use onclick on the div

    Code:
    onclick="location.href=http://whatever'"
    Hope this answers your question

    Comment

    Working...