Hello, I would like to transfer variables to CSS files to allow ease of use when modifying. ie: stylesheet.css: margin:$margin; Code (markup): config.php $margin = "20px"; Code (markup): so the value in CSS file will be taken from config file, Thx
hi chandan, how to I include the config.php in the CSS file? also, the line you wrote is not valid in Dreamweaver, should it be: margin:<?php echo $margin ; ?>; Thx
Ok, I've seen some people trying to defeat the entire point of using CSS before, but this one ranks right up there. Good way to prevent it from caching. I'm not sure exactly what you are trying to accomplish with that, but I suspect you either are trying to put in an external file one of the RARE cases that **** should be in the markup, or have completely over-thought the solution to your problem. Do you have an example of what it is you are actually trying to do?
Hi Deathshadow, I would like to have few PHP pages with CSS file and one file to deal with for predefined modifications. for example: will have 4 PHP pages, one CSS file and one CONFIG.PHP file. in the config.php file I will be able to change and set variables that will be used in the PHP files and the CSS file, this way I will be able to edit one file for all the changes I need. (not me actually, but my user). Thx
Honestly, I'd make the CSS file static, and any values you need to change send in the markup... Which is one of the FEW cases I'd say to put presentation in the markup. The reason being if you send the CSS from a php file, the CSS won't cache, which is one of the reasons to USE external CSS in the first place. Another approach I'd consider is either giving your php permission to write to a static .css file, or connecting to yourself via FTP to write it that way... at the end of the day, what you really want is that CSS file to be static for 99.99% of users so it can cache, otherwise you've defeated the point of HAVING CSS in an external file, and might as well go back to using HTML 3.2 without it.