I am trying to style a text input field. So far, I tried to use borders and images as background but that's not a scalable solution. How could I style an input field like the one in the image below?
Asked
Active
Viewed 341 times
1
-
1[This](http://www.css3.info/preview/box-shadow/) will help you – Ron van der Heijden Feb 11 '13 at 13:52
-
1Have you tried anything so far? Done any research? Look at using a gradient for the border along with an inner `box-shadow`. – Andy E Feb 11 '13 at 13:53
-
http://stackoverflow.com/questions/11361075/responsive-input-fields-in-css-fluid-width -- Possible duplicate – Raphael Rafatpanah Feb 11 '13 at 13:55
2 Answers
4
Use CSS3 box-shadow
property. Example:
input[type=text] {
box-shadow: inset 2px 2px 2px 2px black;
}

Morpheus
- 8,829
- 13
- 51
- 77
2
Agree with @Morpheus. Also you can use 2 shadows at the same time:
input[type=text] {
box-shadow: inset 0 2px 2px 2px #000, inset 0 -2px 2px 2px #fff;
}

AnilkaBobo
- 260
- 1
- 9