Question about Styling:
Embedding extra styles with noscript
Define css if javascript is not enabled
I'm looking to define specific CSS styles only when Javascript is disabled. Currently, I'm using the following code:
<noscript>
<style type="text/css">
.needjs {display:none !important;}
.mwnojs { margin-top: 40px !important; }
</style>
</noscript>
However, I encountered an error while trying to validate the page source: "Element style not allowed as child of element noscript in this context".
What would be the correct approach to achieve this without invalidating my markup?