CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 16th, 2003, 09:36 PM
bruce66 bruce66 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 11 bruce66 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
  #2  
Old September 16th, 2003, 09:40 PM
bruce66 bruce66 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 11 bruce66 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #3  
Old September 17th, 2003, 03:46 AM
Winters Winters is offline
Bad Coder
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jul 2003
Posts: 1,744 Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 12 h 3 m 32 sec
Reputation Power: 171
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.

Reply With Quote
  #4  
Old September 17th, 2003, 04:10 AM
IBM IBM is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 173 IBM User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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

Reply With Quote
  #5  
Old September 17th, 2003, 06:45 AM
Winters Winters is offline
Bad Coder
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jul 2003
Posts: 1,744 Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 12 h 3 m 32 sec
Reputation Power: 171
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.

Reply With Quote
  #6  
Old September 17th, 2003, 04:35 PM
lisajill lisajill is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 152 lisajill User rank is Private First Class (20 - 50 Reputation Level)lisajill User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via ICQ to lisajill Send a message via AIM to lisajill Send a message via Yahoo to lisajill
__________________
Lisa
distant, early morning

Reply With Quote
  #7  
Old September 17th, 2003, 06:14 PM
Phil_work Phil_work is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: Canberra, Australia
Posts: 317 Phil_work User rank is Corporal (100 - 500 Reputation Level)Phil_work User rank is Corporal (100 - 500 Reputation Level)Phil_work User rank is Corporal (100 - 500 Reputation Level)Phil_work User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 19 h 42 m 18 sec
Reputation Power: 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

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Reloading page with different CSS


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway