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 4 of 4
  1. #1
    Regular Coder
    Join Date
    Aug 2009
    Posts
    131
    Thanks
    28
    Thanked 7 Times in 7 Posts

    Custom background for input boxes - wrong padding

    Hello.

    I want to use custom background images for some of my input boxes. Works great adding it in, however, the padding of the text is wrong. And if I set a padding value to the CSS, it all goes wrong!

    Here's an image of how it looks right now:


    Here's my CSS:
    Code:
    input.custombox {
    	background: url(elements/custom.gif) no-repeat;
    	width: 100px;
    	height: 19px;
    	border: 0px;
    }
    Last edited by [vengeance]; 11-08-2009 at 05:07 PM.

  • #2
    met
    met is offline
    Regular Coder
    Join Date
    Oct 2009
    Location
    United Kingdom
    Posts
    728
    Thanks
    4
    Thanked 119 Times in 119 Posts
    can't really tell from the screenshot but if you add padding to the text and the image isn't big enough to accomodate the text you'll run in to display problems

  • #3
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,858
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    You'd need to set suitable padding instead of height, say padding:1px 3px;
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    [vengeance] (11-08-2009)

  • #4
    Regular Coder
    Join Date
    Aug 2009
    Posts
    131
    Thanks
    28
    Thanked 7 Times in 7 Posts
    Quote Originally Posted by abduraooft View Post
    You'd need to set suitable padding instead of height, say padding:1px 3px;
    That did the job, thanks!


  •  

    Posting Permissions

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