This useful bit of code enables you to have links on your page which will let the user turn off your stylesheet.
This will mean the user will see your page without any CSS formatting whatsoever.
It is a very easy script, place this code in your <head> tag;
|
<?php if( $_GET['css'] != 'false' ) { ?> <link rel="stylesheet" type="text/css" href="mystyle.css" /> <?php } ?> |
You put your link to your *.CSS file where the link is so now it is inside the IF statement. Now for the links.
Turn off CSS
| <a href="?css=false">turn off css</a> |
Turn on CSS
| <a href="?css=true">turn on css</a> |
And there you have it, one simple code for one very nice feature on your site!


