Home > database >  Put a link on an Image Sprite
Put a link on an Image Sprite

Time:01-16

I'm having a difficulty linking image sprites. I want them to lead to particular websites but when I click the image sprite, it doesn't work at all. Are all image sprites like this? Could there be an alternative solution? enter image description here

<div >
     <div ><a href="#"></a></div>
     <div ><a href="#"></a></div>
     <div ><a href="#"></a></div>
     <div ><a href="#"></a></div>
     <div ><a href="#"></a></div> 
</div>

CSS:

.fb {
  background: url('../images/sites.png') no-repeat -79px -109px;
  width: 302px;
  height: 302px;
}

.ig {
  background: url('../images/sites.png') no-repeat -459px -110px;
  width: 307px;
  height: 307px;
}

.yt {
  background: url('../images/sites.png') no-repeat -852px -115px;
  width: 299px;
  height: 299px;
}

.twt {
  background: url('../images/sites.png') no-repeat -1244px -114px;
  width: 295px;
  height: 293px;
}

.pin {
  background: url('../images/sites.png') no-repeat -1632px -112px;
  width: 293px;
  height: 293px;
}

CodePudding user response:

Add the div within a hyperlink

<div >
    <a href="#">
        <div >
        </div>
    </a>
    <a href="#">
        <div >
        </div>
    </a>
    <a href="#">
        <div >
        </div>
    </a>
    <a href="#">
        <div >
        </div>
    </a>
    <a href="#">
        <div >
        </div>
    </a>
</div>

CodePudding user response:

<div ><a href="**Enter specific Link Here**"></a></div>

you need to give specific links in href attribute like www.facebook.com

CodePudding user response:

Paste your Links in href="" Example

<a href="https://facebook.com/user...."><div ></div></a> And Place img <div> tag inner <a> tag For you click the div it redirect

Get your Links in Corresponding social media https://www.facebook.com/username

  •  Tags:  
  • Related