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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application variables vs. Style Sheets

Status
Not open for further replies.

calista

Programmer
Joined
Jan 24, 2001
Messages
545
Location
US
I am in the process on designing our corporate intranet site (which will be done in CF if I have my way), and I was wondering about using application variables or style sheets for display elements. In the process of converting a departmental website to be Netscape compatible, I found that I could not use a style sheet to define a table width as a percentage, nor did it seem to let me define a font style in a class I applied to a table.

The way I see it, the advantage of using application variables is, I have only one place to change them, and the change is global. Since I have to specify everything separately for Netscape, that seems like the way to go. However, style sheets also give you a way to make global changes. What do you folks do? What pros and cons do you see? I am also going to attempt to use the Fusebox methodology with my new site.

Thanks for your input! Calista :-X
Jedi Knight,
Champion of the Force
 
netscape should let you define the class but you have to consider that the netscape dynamic HTML is case sensitive that is ".test{font-...}" in the css file is not the same as class="Test" in the template and netscape will require to id the element you are applying styles to e.g.:

<table class=&quot;test&quot; id=&quot;test&quot;...

you can also try to apply styles to the <td> tag if styles in the <table> tag does not work for the whole table;
I believe that the netscape is the only browser that follows that recommendation by the 3WC;
aside that, by using separate css file to apply styles to the template you will put less strain on the cf server and you will make your application run faster because the css file once downloaded is stored in the client cache Sylvano
dsylvano@hotmail.com
 
Calista,
I'd use a stylesheet as much as possible. What I would suggest is if you have to use Netscape, do a check in the application.cfm for they type of browser and depending on if it is MSIE, then add a link to the style sheet there or whatever

e.g
<cfif find(&quot;MSIE&quot;,cgi.http_user_agent)>
<!--- Using IE, add style sheet --->
<cfhtmlhead text='<link rel=&quot;stylesheet&quot; href=&quot;mystyle.css&quot;>'>
<cfelse>
<!--- Not using IE, do something else --- >
</cfif>

Or something like that. There is probably a much better way to more accurately determine the browser. There used to be some custom tags in the tag library that will get you a lot more information.

HTH,
Tim P.
 
I would concur with CFDude. In terms of the table issue, I believe in applying the style to as close to the element as possible. In this case the <td>.

If you keep your style abstracted and your app structure abstracted, you will have a very scalable solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top