How to add button inside input

Vlad Otrocol picture Vlad Otrocol · Mar 9, 2013 · Viewed 251.7k times · Source

I am trying to achieve this: enter image description here

I just want to show a button inside an input element just like the above image

Answer

Alfo picture Alfo · Mar 9, 2013

The button isn't inside the input. Here:

input[type="text"] {
    width: 200px;
    height: 20px;
    padding-right: 50px;
}

input[type="submit"] {
    margin-left: -50px;
    height: 20px;
    width: 50px;
}

Example: http://jsfiddle.net/s5GVh/