I would like to add a feature onto my site that would allow a user to choose between multiple styles. I have seen this feature on other sites. How would I go about doing this or could somebody refer me to a tutorial or guide on how this can be done?
Share
To start you off, you could simply make the stylesheet link(s) dynamic:
And provide links that change them:
On the server, assign
$styleaccording to the query string, it would also be a good idea to default to something in case the user decides to modify the URL:You can propogate the user’s style via the query string, cookies or sessions.