0

I'm working on adding some icons to my company's website, but I'm having trouble getting them to link to a page.

I'm using an image sprite and CSS to change the image on hover. If you click here and look under Services We Offer you can see the image hover.

I'm using a div to do this, with this code:

<div class="video-box"></div>

And in my CSS:

.video-box {
width: 184px; 
height: 222px; 
background: url("http://bluestarmultimedia.tv/wp-content/uploads/2015/01/rollover-video-2.png") no-repeat scroll left top transparent; 
display: block;
}
.video-box:hover {background-position: -184px 0px;}

When I add a link like this, it doesn't work.

<a href="http://google.com"><div class="video-box"></div></a>

How can I get the images to link and keep the roll over?

3 Answers3

0

These are some of the scripts that the website use. I think you will need to import the required JQuery scripts that are used in this website.

<script type='text/javascript' src='http://bluestarmultimedia.tv/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1'></script> 
<script type='text/javascript' src='http://bluestarmultimedia.tv/wp-content/plugins/revslider/rs-plugin/js/jquery.themepunch.tools.min.js?ver=4.6.5'></script> 
<script type='text/javascript' src='http://bluestarmultimedia.tv/wp-content/plugins/revslider/rs-plugin/js/jquery.themepunch.revolution.min.js?ver=4.6.5'></script> 
<script type='text/javascript' src='http://bluestarmultimedia.tv/wp-content/themes/x/framework/js/dist/site/x-head.min.js'></script> 
<script type='text/javascript' src='http://bluestarmultimedia.tv/wp-content/plugins/x-shortcodes/js/dist/site/x-shortcodes-head.min.js'></script>
宿命的な孤独
  • 325
  • 1
  • 4
  • 18
0

Just test your code in Fiddle and it worked fine, maybe you need to specify more about what you really face with. Or you could make div with link function by using span and z-index.

HTML

<div class="video-box">
    <a href="http://tw.yahoo.com"><span></span></a>
</div>

more CSS

.video-box span {
  position:absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 1;
}
Jasper Chang
  • 50
  • 2
  • 7
0

I think there is no problem with your code.It is working as you want.With This

<div class="video-box"></div>

And this

<a href="http://google.com"><div class="video-box"></div></a>

Here is JSFIDDLE

Istiak Tridip
  • 199
  • 1
  • 14