If this is not a scary amount of dynamic values, it is much better to have a static CSS file and redefine only those parts that dynamically change inside the document, where PHP already works anyway. It saves the request (plus the time it takes to boot, etc.), and makes most of the stylesheet available.
In the header section of the PHP / HTML page:
<link rel="stylesheet" href="styles.css"> <style type="text/css"> body { color: <?php echo $body_color; ?>; } h1 { font-size: <?php echo $fontsize."px"; ?>; } p { color: <?php echo $paragraph_color; ?>; } </style>
Pekka μ
source share