Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

html input with background image

Tags:

html

css

Hello guys i have set background image on my input text and text area but i have few little problems

I have attached image. How i can change text start up position in Name text input?

and my text area is bigger then my background image

this is my Name text input with style

input type="text" name="txtName" class="input" />

.input
{
    border: 0px solid #444444;
    height:39px;
    width:346px;
    background:url(images/Contact_05.jpg) no-repeat right top; 
    color:#fff; 
    padding-left:4px; 
    font-size:20px;
    }

and here is my text area

<textarea rows="5" cols="0" class="inputMessage"></textarea>
.inputMessage
{
    border:0px solid #444444;  
    height:386px; 
    width:685px;
    background:url(images/Contact_20.jpg) no-repeat left top; 
    padding-left:4px; 
    color:#fff; 
    font-size:20px; resize:none;
    }

any advice? enter image description here

like image 435
Irakli Lekishvili Avatar asked Jan 12 '12 22:01

Irakli Lekishvili


2 Answers

Set the padding-left to a greater value on your inputs, and decrease the width of your textarea.

When you're designing your form it would be good to put a temporary border around your inputs to see where they are actually positioned, and when you're done just take it off.

like image 164
Matt K Avatar answered Oct 12 '22 06:10

Matt K


padding:10px;

(or more) on input and textarea.

like image 25
Erick Avatar answered Oct 12 '22 08:10

Erick