Media Query behavior different between Codepen and GitHub Pages

The navbar on my portfolio has a default width of 100% under 600px, but changes to 70% once the screen is 600px.

This is correct on Codepen, but doesn’t work on GitHub Pages. On GitHub pages, my default style of 100% width is ignored and the styles for the 600px media query is display even under 600px.

Do you know what the issue is?

edit: Nevermind… I was using the dev tools to use different devices dimensions to test the media queries. Apparently this is different from just resizing the window.

If you came across this with the same issue, it’s because you need this line of code

<meta name="viewport" content="width=device-width, initial-scale=1.0">

Apparently codepen does this for you. My media queries are working properly on GitHub Pages now.