View Single Post
Old 08-17-2012, 02:48 PM   PM User | #1
shivup
New Coder

 
Join Date: Aug 2012
Posts: 10
Thanks: 2
Thanked 0 Times in 0 Posts
shivup is an unknown quantity at this point
Set hyperlink to image class??

Hello Guys,

Is there any way I can set hyperlink to a image which is in image class in css?

for ex.
I have this

<div class="thumbnail"><a href="/test/test1.php"><img src="/images/covers/test.jpg" alt="test" class="bkmrk" /></a>

and here is my css file

.thumbnail {
float: left;
width: 20%;
text-align: center;
margin-bottom: 20px;
}

.thumbnail img {
height: auto;
width: 95%;
max-width: 150px;
padding-top: 20px;
}

.thumbnail .bkmrk {
background: url(/images/gold-bookmark.png) no-repeat 15px top;
}

and my output is



is there any way I can set an hyperlink to this gold-bookmark.png image.. when i click on gold-bookmark.png it should take me somewhere and when i click on actual test.jpg it should take me to /test/test.php.. It seems impossible to me.. let me know if you have any solutions how to do it.. I am willing to do any necessary changes since output will be the way I want..


thank you
shivup is offline   Reply With Quote