|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Reloading page with different CSS
Is it possible, through a link on a page, to reload that page with a different CSS, that is, different page definitions?
I'd like to have a page with 5 or so different buttons, links, etc, which will demonstrate different layouts of that page. Interesting, eh? |
|
#2
|
|||
|
|||
|
Why doesn't this work?
<?php if ($csstype == "style_1") { <link href="style_1.css" rel="stylesheet" type="text/css"> } elseif ($csstype == "style_2") { <link href="style_2.css" rel="stylesheet" type="text/css"> } else { <link href="style_1.css" rel="stylesheet" type="text/css"> } ?> Last edited by bruce66 : September 16th, 2003 at 11:49 PM. |
|
#3
|
|||
|
|||
|
So many issues with that code, I won't even start.
You really should be asking this question in the PHP forum. Even though it has to do with stylesheets, it is a dynamic issue. |
|
#4
|
|||
|
|||
|
building off of the 2nd post, and using javscript there are so many ways to do this.
one: Use innerHTML to rewrite the link element using a diff stylesheet. two: using query strings and if statements to check what stylesheet should be used. three: I think you can use css to define alternate stylesheets, but I stopped reading on that subject.. looked like to much work for me.. and I'm too lazy ![]()
__________________
We all have souls.... where do you want your to go? The little princess Back from the dead The only Hope / End Times |
|
#5
|
|||
|
|||
|
You can easily change the stylesheet with CSS or JS, but I assumed that you would want the user to be able to retain their choice. A mix of JS and cookies could perform this, but I would use one of the server-side languages personally.
|
|
#6
|
|||
|
|||
|
javascript:
http://www.alistapart.com/stories/alternate/ PHP: http://www.alistapart.com/stories/phpswitch/ Hope that is what you wanted, anywa. =) |
|
#7
|
|||
|
|||
|
for some working examples of the above post check out
http://www.101webtech.com http://www.centrelink.gov.au/intern...0102/change.htm These rely on alternate stylesheets and cookies... my CSS hero's site Eric Meyer http://www.meyerweb.com/ Check out the presentation links and the advanced setup good luck |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > Reloading page with different CSS |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|