Results 1 to 3 of 3

Thread: Image size of a button

  1. #1
    Join Date
    May 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Image size of a button

    Hi,

    I have added an image to my button. If I increase the size of the button, the image is visible in tile form. How do I stretch the image of the button.

    Code:
     
                   <input id="zoomOutButton"  style="background-image:url(images/ZoomOut.bmp); background-position: center; width: 25px; background-color: transparent;" type="button" onclick="DoZoomOut();" title="Zoom Out"/>
    Can anyone please help me figure out, what do I need to change to achive my requirements.
    Any help is really appreciated.

    Thanks

  2. #2
    Join Date
    Feb 2007
    Location
    England
    Posts
    254
    Thanks
    0
    Thanked 5 Times in 5 Posts

    Default

    Just add this

    Code:
    repeat-x
    to the button style background.


  3. #3
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by tvd View Post
    I have added [a background] image to my button. If I increase the size of the button, the image is visible in tile form. How do I stretch the image of the button.
    You cannot. Background images are either rendered as-is, or tiled. Only foreground images can be resized, and then the browser typically does a bad job through the use of pixel-based resizing methods.

    Quote Originally Posted by Bob90 View Post
    Just add this

    Code:
    repeat-x
    Erm, that tiles the background, though only horizontally rather than vertically as well.
    Mike

Bookmarks

Posting Permissions

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