I have a text area and I added some CSS to it
<textarea watermark="Have a question? ..." class="test-input" rows="4" cols="15" name="">Have a question? ...</textarea>
and CSS applied to it -
.test-input { border: 1px solid #D0D0D0; border-radius: 3px 3px 3px 3px; color: #646464; float: left; font-family: Arial; font-size: 12px; height: 20px; margin: 0 0 0 15px; padding: 5px; resize: none; width: 264px; }
And I get a text area with some padding inside it. In those cases when it works absolutely normally, the height of the text area is 20 pixels in increments of 5 pixels, not included in the height. But in some cases, the height of the text area includes padding, and the height is reduced to 8 pixels. I searched for any css if you override it, but I did not find it. And I compared the result in both cases. On the left is the reduced height, and on the right is the expected height.
I can fix this problem in other cases, specifically controlling the height by adding! Important or using some kind of JavaScript. But, I wonder what the reason here is making such an effect. Why and in what cases gaskets are included with height or width?
Ashmah
source share