Click to See Complete Forum and Search --> : applying background image to link tag


accetdinesh
01-20-2009, 04:10 PM
hi,
I need to apply a button like background image to the link tag.

Im using a <UL> and its <li> element are added dynamically.

The elements are <a href=> link tags added by inner HTML as below:

var n = document.createElement("li");
n.innerHTML='<a href="#" onclick="getDetails()">value</a>';
document.getElementById("tableList").appendChild(n);

I need to apply a background image to the above link tag.
The image should be resized properly along with the text and the text should
be aligned center.

Please help me.

Thanks in advance.

Fang
01-21-2009, 07:12 AM
The image should be resized properlyYou can't resize background images client side.

Perhaps you mean resize the link?

infinityspiral
01-22-2009, 01:16 PM
Yep background images in CSS don't scale they can only be clipped.