For a website I'm making, I'm using percentages for the divs and so when I resize the browser window, the website layout gets messed up. How should I keep using percentages and make the layout stay the way it is upon browser resizing?
Prevent Browser Resize Css CSS can be used to prevent browser resizing. By using the max-width property, you can set a maximum width for the browser window. If the browser window is resized to be smaller than the max-width, the browser will automatically adjust the size of the elements on the page.
* Press Alt+Space to bring up the window menu, press S to choose the Size option, use the arrow keys to resize the window, and lastly Enter to confirm. * Click the Maximize button in the top right corner of the window.
when you set width in %, try setting min-width and max-width in px
Check this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With