Home arrow Style Sheets arrow Page 4 - Customizing styles: User-Controlled Style Sheets - Part II

Customizing styles: User-Controlled Style Sheets - Part II

In this second article of a three-part series, you will learn how to allow visitors to your website to view an entirely different, more visually accessible style sheet from the "default" one. Normally, providing more than one style sheet causes browser conflict issues -- but with a little bit of JavaScript, we will solve this problem.

Author Info:
By: Alejandro Gervasio
Rating: 5 stars5 stars5 stars5 stars5 stars / 13
April 13, 2005
  1. · Customizing styles: User-Controlled Style Sheets - Part II
  2. · Changing entire style sheets: the first basic approach
  3. · Listing full source code
  4. · Summary and further reading

print this article

Customizing styles: User-Controlled Style Sheets - Part II - Summary and further reading
(Page 4 of 4 )

And that's about it. In this second part, I hope you've enjoyed the handy technique I explained for changing two style sheets in a Web document. It should have offered you some insight into JavaScript's processing power for manipulating CSS style changing without getting a single foot into server-side approaches. Everything has been maintained within the domain of the client.

However, there are a couple of issues yet to be considered. First, what's the point on swapping style sheets if we cannot make the process reversible? And second, if we were able to turn on and off style sheets alternately in a single Web document, the change would be kept only until the next page request. If the user ever had the "bad" idea to click on any links, our carefully crafted technique to swap style sheets would be gone with the wind. Obviously, the whole process is stateless.

These issues should be efficiently addressed. Those reasons are good enough to head us directly to the last part of this series. In it, I'll be discussing and implementing some interesting approaches to change any number of styles sheets, and making that change persistent across several Web pages. Want to know more? Just stay tuned until the next article. The wait will be worth it!

DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus

- CSS Padding Overview
- CSS: Margins Overview
- Top CSS3 Button Tutorials
- More Top CSS3 Tutorials for Animation and Im...
- CSS Mega Menus: Adding Extra Sections
- CSS Mega Menus
- CSS3 Accordian Menu: Horizontally Display Hy...
- CSS Combinators: Working with Child Combinat...
- CSS Combinators: Using General Siblings
- Intro to CSS Combinators
- CSS Semicircles and Web Page Headers
- Drawing Circular Shapes with CSS3 and Border...
- More CSS Pagination Link Templates
- CSS Pagination Links
- Animated CSS3 Image Gallery: Advanced Transi...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials