Why does a horizontal scroll bar appear when i set the width to 100vw?
https://codepen.io/saad-shehzad-the-bashful/pen/NWZdMmR you can check my code here its a mobile issue like i dont want the scroll bar i can just use overflow-x hidden but it just doesnt center and its not the best practice so what to do?
5 Replies
setting width to 100% isn't necessary, divs already stretch to fill the full width of the page
cause you're setting it in a media query, and you have a width set on it outside, you can just remove it in the mediaquery by using
width: unset;
OMG jochem you are a life saver
life saver count:2
glad to help 🙂
How do you decide when to use unset vs revert ?
I try to remember one of them, and pick whichever I remember first
there's a difference, but I'm not familiar with what it is 😄