简体   繁体   中英

padding the text of a HTML input field

I have a HTML input field.

If I do

padding-left: 10px

, it will move the text of the input field to the left BUT, the right side of the input field (or right side of the box) disappears - (please see the attachment).

What CSS setting can I use to fix this?

TIA 在此处输入图片说明

You should use box sizing property. Always use this in your reset.css :

* {box-sizing:border-box;}

在您的CSS文件中

input {box-sizing: border-box;}

use below css:

input {box-sizing: border-box;}

Also provide width to your input field

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM