Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variables in CSS?

Status
Not open for further replies.

andrewfr

MIS
May 22, 2003
66
0
0
GB
I am new to CSS and so would appreciate any help you can give.

We have an internal information system which consists of Word and Excel documents linked through hyperlinks. This is now going to be updated so that all the files will be converted to html and accessed through a browser.

One of the problems we have had with the old system is when a department changes name. All the documents - could be several hundred - have to be changed. I should add at this point that it started off very small and just grew and grew without any planning.

We are trying to remedy this by putting the means in place to have a variable stored and then reference that variable in the appropriate documents. Is there a way to do this with CSS? I am using FrontPage as the editor for this but if there is a better tool then I would try that.

Regards

Andrew.
 
You could build the css dynamically based on the variables passed; I did this once with JSP:

Code:
<style>

.class1 { color: <%=colorVariable%>;
          font-size: <%=fontSizeVariable%>;
        }

and so on. You could do this just as well using JavaScript to pull the variables from a querystring appended to the URL. Check out thread216-820392 in the JavaScript forum for info about pulling variables from the querystring with JavaScript.

good luck!

tigerjade :)




"Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live." -- Martin Golding


 
CSS will not do what you want but any scripting language will. You just need a common file with the display values defined as constants. then use a script or variable name placed on the page to show the constant value.

Chris.

Indifference will be the downfall of mankind, but who cares?
 
Thanks for the replies guys. Not a programmer so don't know anything about scripting languages so will have to do some research.

Thanks again

Andrew.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top