Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to show image in the image box without stretching its original size of the image

    i have image button i need to display image .if the size of the image button is 100*100 and image size is 50*50 .the remaining space of the image button should be empty.the image should not stretch.

    can any one guide me i am new to programming

    Thanks in advance!!!

  • #2
    Regular Coder
    Join Date
    Sep 2011
    Location
    Sweden
    Posts
    154
    Thanks
    1
    Thanked 22 Times in 22 Posts
    Code:
    <button style="width:XXXpx;height:YYpx;background:url(myImg.jpg) no-repeat center center">
    Replace XXX with a width in pixels, replace YY with a height in pixels, replace myImg.jpg with the name (and path if in another folder) to your image.


  •  

    Posting Permissions

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