dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: applying background image to link tag

  1. #1
    Join Date
    Jan 2009
    Posts
    8

    Question applying background image to link tag

    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.

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    The image should be resized properly
    You can't resize background images client side.

    Perhaps you mean resize the link?

  3. #3
    Join Date
    Mar 2007
    Location
    USA
    Posts
    449
    Yep background images in CSS don't scale they can only be clipped.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles