Jump to content
  • Advertisement
Sign in to follow this  
Christian Weis

[web] Selecting css-file in HTML

This topic is 4146 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all, I would like to ask if it's possible to have a html-page where all available css-files are listet. Maybe by searching a directory for css-files. When the user selects one of them, this css is made *active* for all html files. All this has to be done without ASP or any other dynamic html-generator! All with html-tags + javascript! Is it possible somehow? cu, Chris

Share this post


Link to post
Share on other sites
Advertisement
It would be pretty easy to build one in javascript, however it wouldn't be able to browse directories for them, you'd have to specify what was available within the JS code.

Google quickly led me to this: style Sheet Switcher (v1.1).

Share this post


Link to post
Share on other sites
Wonderfull! That's what I'm looking for. Thank you very much. And I think I can get around the restriction that all css-files need to be inserted in all htmls! Maybe by puting 10 -files in the header like this:

<link rel="stylesheet0" type="text/css" name="style0" href="style0.css" />
<link rel="stylesheet1" type="text/css" name="style1" href="style1.css" />
...
<link rel="stylesheet9" type="text/css" name="style2" href="style9.css" />

This way I can support up to 10 styles! But what if I have less styles? How can I catch the error that some css-files are missing and switching to the default-style then automatically?

cu,
Chris

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!