Like This Site? 
 
RSS Feed Follow Us 

on Twitter! Be Our Fan!

Developing Multiple CSS - Let the user choose the style he prefers

Share this post!
 Vote this!

In this tutorial we'll see how you can let your visitors choose the style of your website.
To achieve this we'll use different css stylesheets, and some php to change amongst them.
This is the standard line you use to include a CSS document.


<link rel="stylesheet" href="css/style.css" type="text/css">
 
All we'll have to do is dynamically replace the CSS filename, to make this we'll use a separate file to handle the CSS choice that we name myfunctions.php.
The user will be able to switch CSS clicking on some links: these links will link to the same page and will append the CSS of choice to the query string so that we can parse the $_GET values.
The content of myfunctions.php is:  more...

0 comments:

Post a Comment