I have now managed to get the sidebar to stay at 300px wide using this code that I found in another post on here.
@media (min-width: 769px) {
#right-sidebar {
width: 330px;
}
.right-sidebar #primary {
width: calc(100% - 330px);
}
}
@media (max-width: 768px) {
#right-sidebar {
display: none;
}
}
But unfortunately the sidebar doesn’t disappear until the screen is around 750px wide. So it takes up half the screen at this point!
How do I now set it up so that the sidebar will disappear at around 1000px or less?
I tried changing the max width value to higher. It disappears sooner but just leaves an ugly grey box as the main content doesn’t resize to fill the gap.