1

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?

enter image description here

aspiring
  • 1,457
  • 2
  • 17
  • 43
Andrew
  • 6,008
  • 15
  • 55
  • 92

2 Answers2

4

Use CSS3 box-shadow property. Example:

input[type=text] {
    box-shadow: inset 2px 2px 2px 2px black;
}
Morpheus
  • 8,491
  • 13
  • 49
  • 73
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