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 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?

How to remove watermark from an image or picture

A watermark is any recognizable text, logo or pattern that appears over an image to identify the owner of the image and generally used to prevent unauthorized reuse of the image. Watermarks are usually transparent and can be difficult to remove. The difficulty or ease of removal depends on the content of the image and the position, color, size etc of the watermark.