By default the CSS Width property is set to value “Auto”. What width value is used on an element when Width is set to “Auto”?
If we nest a textbox (
<input type="text" />
) inside div element, the width of which is smaller than that of a textbox, then part of textbox is displayed outside the div element (I think it's called overflowing, but I’m not sure)
.
<div style="width:120px; background-color:Aqua;">
<input type="text" style="width:1000px;" />
</div>
I realize one way to handle this problem is for nested element to have its CSS width property set to some percentage value V ( 0% < V < 100% ), but is there also a more elegant way of forcing nested elements to automatically adjust their width to that of the parent element and so that they wouldn’t overflow?