Forum Moderators: not2easy

Message Too Old, No Replies

cgi variables vs css

Which is better for formatting text

         

mbaze

4:35 am on Sep 8, 2004 (gmt 0)

10+ Year Member



I have a classified ads script written in Perl that I'm using to power a listings site. The script is a few years old and uses a combination of variables (ie: $link_color = "#666633") and inline HTML to format the text in the dynamic pages that it produces. I really want to convert the formatting to CSS. My question is, will page load times degrade if I scrap the variables for formatting and attach an external style sheet, calling the styles from there instead of the script? Users already have to wait for the script to generate the pages. Will they have to wait longer for those pages to then call the style sheet?

Apologies if this post is better suited for the Perl forum.

TheDoctor

7:16 am on Sep 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Page load times will be reduced with an external CSS file, since the browser will only have to download the rules once instead of loading them again and again every time the user sees a new page. This is one of the advantages of using an external CSS file.

lexipixel

11:39 am on Sep 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The added bonus is you can match the appearance of the HTML produced by the scripts and the static pages of the site more easily. (I share a single CSS file with 12 scripts on one site -- everything is "seamless"...).

I'd go for it if I were you.