hey I am writing a little website and I am using w3css that I find very simple and nice.
I have the body
with max-width:100%;
; a sidebar class="w3-hide-small"
with width: 15%;
and a main
with margin-left:15%; width:85%;
But when the sidebar is hidden on small screen, the main is still 85% and it remains a 15% white on the right of the browser.
I think that I shall do it with javascript cause w3css and I thought this code, but for sure it is full of error.
var Sidebar = document.getElementById('theSidebar');
if (Sidebar.visibility === hidden){
document.getElementById('theMain').style.width = '100%'
document.getElementById('theMain').style.margin-left = '0px'}
But...... it just does not work :D
Suggestions?
Hoping that I described the issue well.
Bye!!!
Andrea