Different window.innerWidth between chrome and firefox?

后端 未结 1 1019
挽巷
挽巷 2021-01-26 22:58
html, body { 
     position:absolute; 
     width:100%; 
     height:100%; 
     margin: 0; 
     padding: 0; 
     overflow: hidden; 
}

The wind

相关标签:
1条回答
  • 2021-01-26 23:35

    It because the with of the document depends on how much of the viewport is available for the application body.

    It will depend on the thickness of the borders of the application, any other plugins which are active etc.

    demo here. This will alert the width of the browser, for me chrome is giving 677 while firefox is giving 674

    var body = $('body')
    alert(body.width() + ' - ' + body.innerWidth())
    
    0 讨论(0)
提交回复
热议问题