Most of you requested a tutorial on how to make images clickable in blogger posts, sidebars and footers so the tutorial today will not only teach you that but will also share the beautiful trick of adding the fading effect to the images i.e. the images will fade on mouse hover. So lets get things done!
How to make an image clickable?
The complete clickable image code looks like this,
<a href="LANDING URL" target="_blank"><img src="IMAGE LINK" width="" height="" alt="" title="" border="0" /></a>
- Where refers to where will the image take the user when it is clicked.
- Where IMAGE LINK refers to the URL of your picture
- width="" and height="" has to be given proper values in pixels
- alt="" is alternative text tag that you right to tell search engine robots what the image is about
- title="" is the name of the image that appears on mouse hover. It is always kept the same as the alt=""
- border="0" ensures that no border or outline appears across the image
<a href="http://www.mybloggertricks.com" target="_blank"><img src="IMAGE LINK" width="240px" height="180px" alt="Clickable Koala image" title="Clickable Koala image" border="0" /></a>
When you click the image, it will take you to our homepage. Else if you want to link to the original size of image then use this code,
How to make the same image un-clickable?
To make any image un-clickable simply remove the href linking tag. After removing the landing address tag we get,<img src="IMAGE LINK" width="" height="" alt="" title="" border="0" />
You will see that the image is no more clickable. and the code I used this time is the same one but without the href tag,
<img src="IMAGE LINK" width="240px" height="180px" alt="unclickable Koala image" title="unclickable Koala image" border="0" />
How to make an image fade in and fade out?
For this you will need to add a tiny CSS3 code to your template. So kindly follow these steps,- Go To Blogger> Design > Edit HTML
- Backup your template
- Search for ]]></b:skin>
- Add the code below just above it
/*---MBT FADE OUT CODE ----*/
.Fadeout img {
filter:alpha(opacity=100);
opacity: 0.3;
border:0;
}
.Fadeout:hover img {
filter:alpha(opacity=30);
opacity:1.0;
border:0;
}
filter:alpha(opacity=100);
opacity: 0.3;
border:0;
}
.Fadeout:hover img {
filter:alpha(opacity=30);
opacity:1.0;
border:0;
}
/*---MBT FADE IN CODE ----*/
.Fadein img {
filter:alpha(opacity=30);
opacity: 1.0;
border:0;
}
.Fadein:hover img {
filter:alpha(opacity=100);
opacity:0.3;
border:0;
}
filter:alpha(opacity=30);
opacity: 1.0;
border:0;
}
.Fadein:hover img {
filter:alpha(opacity=100);
opacity:0.3;
border:0;
}
5. Save your template.
Now whenever you wish to add the fading effect to your image then simply insert an additional code to the same Clickable image code that we discussed above.
To make the image Fade out simply insert
class="Fadeout" to your image code like this,
<a class="Fadeout" href="LANDING URL" target="_blank"><img src="IMAGE LINK" width="" height="" alt="" title="" border="0" /></a>
To make the image Fade in simply insert class="Fadein" to your image code like this,
<a class="Fadein" href="LANDING URL" target="_blank"><img src="IMAGE LINK" width="" height="" alt="" title="" border="0" /></a>
See an example,
I hope you find it useful. If you wanted to know where to save your images or to get IMAGE Links then read this post,
0 Komentar untuk "Fade Effect with Clickable Images In Blogger"