Nathan Nathan - 1 year ago 66
HTML Question

Add padding to HTML text input field

I want to add some space to the right of an

<input type="text" />
so that there's some empty space on the right of the field.

So, instead of , I'd get .

So, same behavior just some empty space to the right.

I've tried using
, but that doesn't seem to do anything.

Is there a way to do this (or fake it)?

Answer Source

padding-right works for me in Firefox/Chrome on Windows but not in IE. Welcome to the wonderful world of IE standards non-compliance.



<input type="text" class="foo" value="abcdefghijklmnopqrstuvwxyz"/>


    padding-right: 20px;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download