If you designate the width of the body of your HTML as a fixed 1440px, it will remain that size regardless of the user's screen dimensions. An alternative approach is to set the width to width: 100%;
and include a max-width: 1440px
. This allows the body to adjust its size based on the screen size - expanding to fit smaller screens and capping at 1440px for larger ones.
If I am understanding your question correctly, you have a sidebar menu and dashboard that should occupy the full screen. In this scenario, you could do:
.side-menu {
width: 20%;
}
.dashboard {
width: 80%;
max-width: 1440px;
}
@media (min-width: 1500px) {
.side-menu {
width: 100%
}
}
Utilizing media queries allows you to assign different CSS properties to elements in your HTML based on screen size. In this example, if the screen size is under 1440px, the sidebar takes up 20% while the dashboard occupies 80%. If the screen size is 1500px or greater (slightly larger than the max-width of the dashboard to accommodate the sidebar), the dashboard remains at 1440px and the sidebar fills the remaining screen width with width: 100%
.
Of course, for larger websites like Facebook, considerations extend beyond just CSS as they need to factor in data flow, user devices, and various other factors.