I am trying to create input text like below Image :
First I used CSS3 with some help like this fiddle . because of problems with old browsers I reached to don't use CSS3.
Now I coded like this :
input[type=text]
{
color: #979797;
height: 28px;
padding-left: 10px;
text-decoration: none;
background-image: url('Pictures/Input-BG.png');
background-repeat: repeat-x;
}
<input id="txtScrictAddress" value="Your Adress (required)" type="text" />
Input-BG.png is this image :
and here is the result.
Styling Input Fields If you only want to style a specific input type, you can use attribute selectors: input[type=text] - will only select text fields. input[type=password] - will only select password fields. input[type=number] - will only select number fields.
A style attribute on an <input> tag assigns a unique style to the input control. Its value is CSS that defines the appearance of the input element.
CSS form is used to create interactive forms for users and provides many ways to set the style. There are many CSS properties available that can be used to create and style HTML forms to make them more interactive.
You just need to set a border radius and border to none. And edit your image so the dark thing is on the left side also.
input[type=text]
{
color: #979797;
height: 28px;
padding-left: 10px;
text-decoration: none;
background-image: url('http://i.stack.imgur.com/pbpVI.png');
background-repeat: repeat-x;
border-radius: 5px; /*up to date browsers support this, but you can add prefixes if you want*/
border: 0;
}
http://jsfiddle.net/TGzng/8/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With