adv banner
Web Programming  Home Web Programming PHP Turn Off CSS
rss

Turn Off CSS

Author: Joseph Skidmore More by this author


Turn Off CSSThis 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!



Rate this Material: Bad 1 2 3 4 5 Excellent
print this page tell a friend subscribe to newsletter subscribe to rss

Add comments to "Turn Off CSS"