Reputation: 63
There is an inconsistency between the width property typed into the CSS and rendered value in combo boxes.
css:
.foo {
width:300px;
padding:10px;
border:1px solid #ccc;
}
html:
<input type="text" id="text" class="foo"><br><br>
<select id="combo" class="foo">
<option>bar</option>
</select>
The "select" element is substracting padding and borders from width before render. Is it normal? If so, theres some documented explanation?
Upvotes: 0
Views: 924
Reputation: 68319
Yes, that's normal. That's how the CSS box model works.
http://css-tricks.com/the-css-box-model/
Upvotes: 1