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,557
  • 2
  • 20
  • 43
Andrew
  • 6,254
  • 16
  • 59
  • 93

2 Answers2

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