PDA

View Full Version : Dynamic CSS?


sladmin
11-05-2007, 01:10 PM
I know this may sound wierd but is there any way I can dynamically update a Cascading Style Sheet?

Reason I'm asking is so I can allow users to login and change the complete look of a webpage.

Can this be done or is there another way of doing this kind of thing?


Thanks in advance,

Mark Voss
11-05-2007, 02:56 PM
Yep - there's no reason a stylesheet has to be a .css file or even a proper file at all.

If you used an asp stylesheet, it could call a users style preferences from an updateable database.

<link rel="stylesheet"
href="styles.asp?userID=<%= rsUser("userID") %>"
type="text/css">

sladmin
11-05-2007, 04:10 PM
Thanks Spanner,

Actually I found quite a lot once I googled it! I found this link and I thought I'd post it for others:

http://www.4guysfromrolla.com/webtech/tips/t071201-1.shtml

Mark Voss
11-05-2007, 04:13 PM
Yep, that's the sort of thing :smilie: