How to pass the 'value' from JPS or HTML to the CSS file?

Discussion in 'CSS' started by navgreat, Mar 5, 2007.

  1. #1
    Hello,
    i'm new to this group and i would like to know, can i pass the value to css file. I've written one css file which consists of many descriptoin of the styles which i've used in my jsp and html pages. What i want is , if some other day if i want to make changes then i've to go to the entire hard-corded .css file then do that. What i want is to make a separate file so that whatever changes i want , i can easily update the file and send the value to the css. Can it is possible to the css. Through this , it will be easy and it's will be the cool gui for the implementation of the css files.
    So, i want to pass the color scheme or the some style sheets represented tags in the css file which i've created. Could anyone help me out in this regard..... Can i pass it though jsp or html???

    in advance thanks.....
     
    navgreat, Mar 5, 2007 IP
  2. Garve

    Garve Peon

    Messages:
    62
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If using a scripting language, the CSS file can have any extension and can accept variables.

    For instance in ASP a stylesheet called styles.asp would work - eg

    -----------------

    <% Response.ContentType = "text/css" %>
    body {
    <%
    if request("color") = "" then
    %>
    color: red;
    <%
    else
    %>
    color: <%=request("color")%>;
    <%
    end if
    %>
    }


    -----------------

    You could use the FSO to pull the styles in from another text document.
     
    Garve, Mar 6, 2007 IP