Is there a deviation in the value of JS offsetWidth?

problem arises: I use js to dynamically set the width of a box, the parent box is width:100%, but js always deviates from the actual value when using offsetWidth to get the value of the parent box. As shown in figure

clipboard.png

May.09,2021

I have the same situation. I measured the width of the scroll bar and found that the 17 pixels with deviation was the width of the scroll bar

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35501-2bf79.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35501-2bf79.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?