I’ve made a burger menu for my portfolio page when at mobile sizes. It animates slides the menu out from the right and slides the <body> off screen to the left (think Facebook app).
Works 100% on local server, however in codePen I cannot seem to style the <body> tag, at least not style the margins. Is there a work around for this?
Oh, I thought you were just wanting to style the body with CSS. Well, after your last comment, I went back and looked at your original JS code and saw the problem: document.getElementById('body')
body is a tag, not an id. Codepen will in fact allow you to style the body with JS and there are two ways to do it:
getElementsByTagName returns a nodelist of elements with the given tag name. Or you can select an element from the list the same way you would from an array. There should be only 1 body, so get the first and only body tag with document.getElementsByTagName('body')[0]
That’s all good to know, but I’d rather just use the much simpler document.body
Either one will work in place of document.getElementById("grid-wrapper") in your JS code, just fyi.