This is a little snippet of Javascript which can redirect your viewer if their browser is not CSS enabled.



This goes in the BODY of the html file.

First declare an ID, as seen below in the span tag, making sure it is placed before the script.

<span id="css" style="position:absolute"></span>

Then add the script as shown below.

<script type="text/javascript">

<!--
if (document.layers) {isCSS = document.css;}

else {isCSS = css;} if (!isCSS) {location.href="not_css.html"}
//-->
</script>

Just change the URL in the script to suit your needs. The script should be typed into the file that is to be viewed using CSS enabled browsers and the URL should be pointing to a page that does not need a CSS enabled browser to view.

Close