Box-sizing: how to get rid of the scrollbar padding in Firefox

后端 未结 1 1929
情深已故
情深已故 2021-01-13 11:51

Here\'s a sample code:


 


        
相关标签:
1条回答
  • 2021-01-13 12:36

    Firefox applies the padding not only to the content but to the scrollbar as well.

    Change your textarea style definition so that it reads like this:

    textarea
    {
        overflow:auto; 
        box-sizing:border-box; 
        -moz-box-sizing:border-box; 
        line-height:26px;
        padding: 0;
        padding-left: 6px;
    }
    

    This corrects the padding issue, but once there are two or more lines of text it will look somewhat awkward.

    0 讨论(0)
提交回复
热议问题