Skip to main content

How to use a background image on an image

Sometime earlier I showed how you can use background images to create cool effects on your website. Recently, I read a nice trick of using background images on images to create cool animations.

You already know that we can set a background image on any element of a website, and under texts. Using the same technique, we can set a background image under an image. Look at the following example. These are two separate GIF animations.

  

Now by setting the landscape GIF as a background to the running leopard, we get this.

Cool isn't it?

Here is the code:

<div style="width:206px;height:100px; background:url(/landscape.gif)"><img style="padding-top:10px;padding-left:10px" src="/tiger.gif"></div>

Comments

Popular posts from this blog

How to Record CPU and Memory Usage Over Time in Windows?

Whenever the computer is lagging or some application is taking too long to respond, we usually fire up task manager and look under the Performance tab or under Processes to check on processor utilization or the amount of free memory available. The task manager is ideal for real-time analysis of CPU and memory utilization. It even displays a short history of CPU utilization in the form of a graph. You get a small time-window, about 30 seconds or so, depending on how large the viewing area is.

How to Schedule Changes to Your Facebook Page Cover Photo

Facebook’s current layout, the so called Timeline, features a prominent, large cover photo that some people are using in a lot of different creative ways. Timeline is also available for Facebook Pages that people can use to promote their website or business or event. Although you can change the cover photo as often as you like, it’s meant to be static – something which you design and leave it for at least a few weeks or months like a redesigned website. However, there are times when you may want to change the cover photo frequently and periodically to match event dates or some special promotion that you are running or plan to run. So, here is how you can do that.

69 alternatives to the default Facebook profile picture

If you have changed the default Facebook profile picture and uploaded your own, it’s fine. But if not, then why not replace that boring picture of the guy with a wisp of hair sticking out of his head with something different and funny?