Style Sheets
  Home arrow Style Sheets arrow Page 4 - CSS Constants
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

CSS Constants
By: Chris Heilmann
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 11
    2005-05-09

    Table of Contents:
  • CSS Constants
  • The CSS standard compliant approach
  • Using ID Selectors and Descendent Selectors
  • Moving server side
  • Using Server Side Scripting Languages
  • More examples
  • Parsing CSS with PHP

  • 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


    CSS Constants - Moving server side


    (Page 4 of 7 )

    There are basically two ways to simulate CSS constants on the server. One involves using the server software and the other involves using scripting languages on the server.

    Using Server Side Includes (SSI)

    Server Software, like Apache and the Microsoft IIS allow for server side includes (SSI). We can use these to simulate CSS constants.

    For Apache, we define a new file extension called “sccs” for “Server Cascading Stylesheets” by adding the following to the configuration file of the server:

     
    Options +Includes
    AddType text/css .scss
    AddHandler server-parsed .scss
     

    Inside one of these new “scss” files we can use the Server Side Includes syntax to set and retrieve our constants:

     
    <!--#set var="blue" value="#369" -->
    <!--#set var="green" value="#363" -->
    ul#navigation{
            background: 
    <!--#echo var="blue" -->;
            color:#fff;
    }
    h1{
            border-bottom:1px solid 
    <!--#echo var="green" -->;
    }

    Many Web space providers won’t allow users to change the server configuration, though. What most provide are Server Side Scripting Languages, that can also be used to simulate CSS constants.

    More Style Sheets Articles
    More By Chris Heilmann


       · Just a suggestion.Safari seems to struggle with just:header(’Content-type:...
     

    STYLE SHEETS ARTICLES

    - 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...
    - Pulling Web Page Elements with the Blueprint...
    - Pushing Web Page Columns with the Blueprint ...
    - Controlling Column Padding with the Blueprin...
    - Prepending Classes in the Blueprint CSS Fram...
    - Appending Grid Units with the Blueprint CSS ...
    - Changing Grid Units in the Blueprint CSS Fra...
    - The Blueprint CSS Framework
    - Building a Liquid Design with Evened Margins...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    Stay green...Green IT