PHP is open source scripting language. It\'s widely used to develop web applications.  Home Web Programming PHP Turn Off CSS
Your Ad Here

Turn Off CSS


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="/img_articles/9119/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="/img_articles/9119/?css=false">turn off css</a>

Turn on CSS

<a href="/img_articles/9119/?css=true">turn on css</a>

And there you have it, one simple code for one very nice feature on your site!



Author's URL: Joseph Skidmore
Thank you for voting.
Rate this Materials:
Bad 
1 2 3 4 5 Excellent
print this page subscribe to newsletter subscribe to rss

Web programming � everything from the basics of visual design and architecture to the specifics of applications, graphics, and scripting. More Web Programming: Most Popular Materials | Fresh Materials | More PHP Tutorials at LearnPHP.org

Add comments to "Turn Off CSS"

Only registered users can write comment

No comments yet...