Please see the snippet for demo.
I'm trying to work out why browsers don't layout input elements according to the absolute positioning rules that apply to other elements. I'm specifically looking for justification in the CSS/HTML spec for this behavior.
.colorPicker {
box-sizing: border-box;
width: 100px;
height: 100px;
border: 2px solid red;
position: relative;
overflow: hidden;
}
.colorPicker * {
display: block;
position: absolute;
top: 5px;
left: 5px;
bottom: 5px;
right: 5px;
}
<p>div is positioned correctly</p>
<div class="colorPicker">
<div style="background: blue"></div>
</div>
<p>'color' input is not sized at all</p>
<div class="colorPicker">
<input type="color" />
</div>
<p>'text' input is too wide</p>
<div class="colorPicker">
<input type="text" />
</div>
<p>'button' input is not wide enough</p>
<div class="colorPicker">
<input type="button" />
</div>