Is it possible to style a text input to fill the width of it's parent?
问题 I have had this issue for years and I've seen similar questions before, but none of them have addressed the fact that when setting width: 100% on an element - paddings, margins and borders will increase the width. Have a look at this Fiddle. The white topmost text box is a standard text box with it's width set to 100% . As you can see it overflows it's parent because of the margin, padding and border settings. The green text box is styled like a div using position: absolute . This works like