Use <noscript>
tags; this website is actually a good example of that.
<noscript>
<div id="noscript-warning">Stack Overflow works best with JavaScript enabled</div>
</noscript>
And with CSS, make it more obvious
#noscript-warning {
background-color: #AE0000;
color: #FFFFFF;
font-family: sans-serif;
font-size: 120%;
font-weight: 700;
left: 0px;
padding: 5px 0px;
position: fixed;
text-align: center;
top: 0px;
width: 100%;
z-index: 101;
}
You could, of course, put it in the center (possibly with position: fixed
) to prevent anyone doing anything with the page.