Workaround for issue with IE scrollWidth

后端 未结 3 1721
死守一世寂寞
死守一世寂寞 2021-02-07 08:44

I seem to have stumbled onto a bug in IE where the scrollWidth is off by 1px compared to the offsetWidth. The trigger to this seems to be dependent on the length of the text/ch

3条回答
  •  庸人自扰
    2021-02-07 09:37

    Try to set the padding-right: 1px; for the class .base.

    .base{
        font-size: 16px; 
        overflow: hidden;
        padding-right: 1px;    
    }
    

提交回复
热议问题