Is it possible to select css stylesheet based on a database output?

Jangga

Junior Member
Joined
Aug 8, 2016
Messages
196
Reaction score
11
Basically I want to make a website that will require an admin to change the colour of a page using different stylesheets as he wish. I dont know how to go about this. So, I'm thinking a db operation would be best. Is that possible?
 
yes it is possible you can change the CSS attributes via js
 
Basically I want to make a website that will require an admin to change the colour of a page using different stylesheets as he wish. I dont know how to go about this. So, I'm thinking a db operation would be best. Is that possible?

The most basic idea that comes in my mind is DB + PHP. You set to db which style is chosen, for example red, green, etc.

Then you load something like this in header:
Code:
if ($color==red) {
$style == 'red.css'
}
 
Back
Top