One pixel extra with a width of 100%
-
28-05-2021 - |
Question
I got a textarea of 680 pixels wide. This needs to be made fluid so I use percentages.
The percentages make a perfect 100% width but it seems to render 1 pixel more than it should.
Solution
And what would be wrong with this:
textarea {
border: 1px solid #333333;
background: #ececec;
margin: 0;
outline: 0;
height: 100px;
padding: 20px; /* */
width: 640px; /* 680px - 2 * 20 */
resize: none; }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow