This link has been bookmarked by 55 people . It was first bookmarked on 21 Jun 2006, by Nkieto.
-
06 Jul 11
-
27 Jun 11
-
13 Jan 11
-
10 Dec 10
-
09 Dec 10
-
07 Dec 10
brent lawrenceGenerating Dynamic CSS with PHP
Introduction
A frequently asked question on the popular css-discuss.org mailing list and archive is, "How do I store and reuse values in my style sheets?"
One reason for this explosive growth is that PHP is free and open source. It’s also a relatively easy language to learn and the de facto standard for developers creating dynamic Web pages. But it is also perfectly suited for deploying CSS and many other Web technologies.
I can certainly relate to this as a programmer—it was one of the first things I thought of when I started using CSS. Because I prefer to separate my work into discrete modules, I immediately recognized the power behind the concept. I was already using PHP, Perl and other tools to generate HTML dynamically, so CSS didn’t seem quite powerful enough. However, it didn’t take me long to learn how to approach style sheets in a similar way.
CSS is designed for layout and presentation. Its goal is to restore HTML documents to their original purpose—to be structural in form and to reflect the flow of the content contained in them. In the brave new world of XHTML, this is mandatory.generate create css php web webdesign tutorial webdev design digital-web.com
-
06 Dec 10
-
16 May 10
-
05 Nov 09
-
PHP is an embedded technology, meaning you can combine the logical/programming code with normal HTML or XHTML markup. In a more general sense, the output can be any text you like—in this case, it’s CSS.
-
Normally, PHP and the Web server it’s running under will automatically tell the browser that a PHP script is HTML. In the case of a static CSS file, the server knows it’s CSS by the file extension. But this is a special case, so our first job is to send the correct media, or MIME type to the browser using the PHP
header()function: -
header('Content-type: text/css');
-
The next step is to define the color scheme sets using associative arrays.
-
-
14 May 09
-
25 Jan 09
-
07 Sep 08
-
02 Sep 08
Felipe LavínOne reason for this explosive growth is that PHP is free and open source. It’s also a relatively easy language to learn and the de facto standard for developers creating dynamic Web pages. But it is also perfectly suited for deploying CSS and many other W
xhtml webdev webstandards webdesign web tutorials tutorial css php from-delicious
-
03 Mar 08
-
03 Dec 07
-
13 Apr 07
-
22 Jan 07
-
04 Nov 06
-
27 Jul 06
-
25 Jul 06
-
12 May 06
-
25 Feb 06
-
25 Jan 06
-
19 Jan 06
-
02 Jan 06
-
13 Dec 05
James BouyA post on how to dynamically generate CSS using PHP and query strings.
-
24 May 05
-
07 May 05
-
06 May 05
-
04 May 05
-
03 May 05
-
01 May 05
-
29 Apr 05
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.