This tutorial is out of date and no longer maintained.
Firstly, the purpose of this post isn’t to call out or shame any specific website’s front-end mishaps or to belittle the hard work that went into them. The purpose is to showcase common errors when doing a fixed-width website and how even some of the most popular and amazing sites we often use overlook them.
With the age of mobile and responsive websites, more and more websites have fluid layouts. I personally feel it’s becoming a standard amongst front-end developers to be developing with percentages or “em” units over pixels when possible; however, occassionally, the CSS can get mixed between fluid and fixed and create unexpected errors in the layouts especially when resizing the browser.
The common errors I often see can be reproduced when:
If your fixed-width website is having layout issues when resizing the browser, being at different viewport sizes, or when scrolling horizontally, a quick-fix CSS trick is to add:
html {
/* Size of largest container or bigger */
min-width: 1080px;
}
Below is a list of sites where you can see the issue in hand. The easiest way to see these bugs I’m highlighting is to just visit the site, resize your browser to be smaller than its largest container, and then scroll to the right. In some cases you’ll see the errors without even scrolling right. Otherwise, you can hover on-and-off the images below to see screenshots of what this fix will correct.
html {
min-width: 960px;
}
html {
min-width: 930px;
}
html {
min-width: 985px;
}
html {
min-width: 1000px;
}
html {
min-width: 1000px;
}
html {
min-width: 1000px;
}
html {
min-width: 1100px;
}
html {
min-width: 1000px;
}
html {
min-width: 1400px;
}
If you know any problems or issues with this fix or alternate solutions, please flag and spread the word in the comments!
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.