I recently did some research on the problem described by the OP for a similar SO question . It seems that the error in Firefox causes the rendering of this so-called "non-complementary, but looking like padding" textarea elements.
Usually this add-on is not a problem, but it becomes a problem when you want the two elements to be the same width, and you make sure that its contents are wrapped equally in both elements.
Getting textarea to wrap content the same as, for example, div elements in Firefox
It seems impossible to get rid of this extended 1.5px on textarea in Firefox, so if you want to make sure that the flow around content inside a div in Firefox behaves exactly like the contents wrap inside textarea in Firefox, the best approach seems to be adding an extra 1.5px indentation on the right and left in the div , but only in Firefox. You can accomplish this by setting the following CSS prefix properties on your div :
-moz-box-sizing: border-box; -moz-padding-end: 1.5px; -moz-padding-start: 1.5px;
The first ensures that the padding set on the div does not increase the width of the div , and the next two ensure that 1.5px indentation is set to the right and left of the div .
This approach does not affect the rendering of div in any other browsers, it does not need it, since textarea in other browsers does not display an additional addition. But this ensures that there is no difference in content between div and textarea inside Firefox if they have the same font-family and font-size properties, etc.
Here's jsFiddle for demo purposes.
Getting textarea to continuously wrap content in browsers
If you just wanted to make sure that textarea in Firefox has the same width and wrapping behavior as textarea in other browsers, you can set its box-sizing to border-box , add padding to both sides of 5.5px and set -moz-padding-end and -moz-padding-start at 0px .
textarea { padding: 0 5.5px 0 5.5px; -moz-padding-end: 0px; -moz-padding-start: 0px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
Shown here is jsFiddle .
source share