Style Sheets
  Home arrow Style Sheets arrow Using Persistent Styles with Multiple Styl...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
STYLE SHEETS

Using Persistent Styles with Multiple Style Sheets
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2007-09-12

    Table of Contents:
  • Using Persistent Styles with Multiple Style Sheets
  • Refreshing some previous concepts and methodologies
  • Working with persistent style sheets
  • Defining some basic JavaScript functions
  • Listing the full source code of the style switching application

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Using Persistent Styles with Multiple Style Sheets


    (Page 1 of 5 )

    If you're a web designer who has experience in the area of web development, then you'll be aware of the advantages of working with separate style sheets when building a web site. However, the really good news is that you can extend these benefits even more if you learn how to work with multiple style sheets, which can be swapped easily to provide users with a better level of customization and accessibility.

    Introduction

    Welcome to the second tutorial of the series that began with "Working with Multiple Style Sheets." As the title suggests, this instructive series shows you how to use several style sheets attached to a given web document, and provides examples of the most common cases, ranging from working with alternate style sheets to using persistent style sheets.

    Now that I have introduced the primary subject of this series, it's a good time to review some of the concepts deployed in the previous tutorial to give you a better understanding of how both articles link with each other. That being said, you'll surely recall that during the first installment, I offered you a friendly introduction to working with multiple, "alternate" style sheets. 

    Speaking in more specific terms, I developed a simple web application that allowed users to switch easily between the different alternate style sheets associated with a particular web document. This provides users with a simple mechanism to change the look and feel of a web page. Of course, as you might guess, the implementation of the mechanism required the combination of some basic CSS styles and the definition of a couple of JavaScript functions, which came in useful for switching between different alternate style sheets.

    Also, it's really worthwhile to note here that building this kind of web application, which allows users to change the style sheets tied to a given web page, is rather useless if this change isn't persistent across the different pages of the entire site. This obviously implies that you may want to incorporate into the application the capability for maintaining the selected style across different pages via the creation of a cookie mechanism, either using JavaScript or your favorite server-side scripting language.

    All right, having reviewed the most relevant topics surrounding the manipulation of multiple alternate style sheets, let's go straight into the subject of this second part of the series. As you'll see in the next few lines, I'm going to demonstrate with various hands-on examples how to modify the look and feel of a determined web document by swapping several "persistent," rather than "alternate," style sheets. In doing so, you'll learn yet another approach to changing the CSS styles of a web page.

    The theme is indeed useful and interesting, so don't waste more time in preliminaries; start learning more about switching persistent style sheets. It's going to be an educational journey!

    More Style Sheets Articles
    More By Alejandro Gervasio


       · This second article of the series introduces you to the use of multiple persistent...
     

    STYLE SHEETS ARTICLES

    - Image Replacement CSS Techniques
    - Using BlueTrip`s Success, Notice and Error C...
    - More Uses for the Thin and Caps CSS Classes ...
    - Styling Definition Lists with the BlueTrip C...
    - Styling Unordered and Ordered HTML Lists wit...
    - Using the BlueTrip CSS Framework`s Thin and ...
    - Adding Borders to Web Page Columns with Blue...
    - Introducing the BlueTrip CSS Framework
    - Using a Background Grid to Assist Web Page L...
    - Extending the Rule Of Thirds for Web Page La...
    - A Two-Column Web Page Layout Based on the Ru...
    - Using the Rule Of Thirds for Web Page Layout
    - Swapping Columns Using the Divine Ratio for ...
    - Using the Golden Ratio in Liquid Web Page De...
    - Fundamental Design Principles for Web Page L...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek