1) When the width property of a textbox element (<input type=”text” />
) is set to inherit
, it does not overflow. However, if the width is set to auto
, it will overflow due to the browser's calculation of the width.
a) Why doesn't the browser consider that the textbox is inside another element and adjust the width accordingly?
b) What parameters does the browser use to determine the width of a textbox?
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<style type="text/css">
p
{
width:60px;
}
</style>
</head>
<body>
<p>
<input type=”text” />
</p>
</body>
</html>
2) Are all HTML elements automatically set to have their width value as auto by default?
Thank you