prime Posted October 17, 2007 Share Posted October 17, 2007 Just a simple question I've tested this in a browser and it works. I know you can set the content-type using the header funtion for example header("Content-Type: text/css"); Does this mean that you can use php to generate a css stylesheet for example instead of having a file names style.css you have it named styles.php that contains <?php header("Content-Type: text/css"); ?> at the top of the file for example here is the start if a test file I have created <?php header("Content-Type: text/css"); ?> body { height: 100%; color: black; } div#topmenu { background: #000066; position: absolute; position: fixed; top: 0px; left: 13%; width: 87%; height: 13%; text-align: center; z-index: 3; } /*styles continue but not needed for this example */ If this is valid, This means you can dynamicaly generate css content, am I right in thinking this. Or is there a problem I'm not realising. If I'm right this could solve a lot of probems I've been having. Is this valid? would it work across all browsers? Quote Link to comment https://forums.phpfreaks.com/topic/73582-solved-dynamic-stylesheets/ Share on other sites More sharing options...
prime Posted October 17, 2007 Author Share Posted October 17, 2007 If this is valid it would allow the power of php to be applied to stylesheets. I'm just asking if it's valid before I go changing everything ove ron my sites, as this would allow a lot of flexibility being able to do variables and if's in styesheets. but I'm hoping for an answer from someone more experienced first if this is valid Quote Link to comment https://forums.phpfreaks.com/topic/73582-solved-dynamic-stylesheets/#findComment-371261 Share on other sites More sharing options...
corbin Posted October 17, 2007 Share Posted October 17, 2007 That is valid ;p. Quote Link to comment https://forums.phpfreaks.com/topic/73582-solved-dynamic-stylesheets/#findComment-371316 Share on other sites More sharing options...
prime Posted October 17, 2007 Author Share Posted October 17, 2007 Thank you :-) Sweet I was browsing my references, and noticed that you can set content types so, html isn't the only output you have to do and I was wandering about stylesheets, wow, this is going to offer a lot of flexibility Quote Link to comment https://forums.phpfreaks.com/topic/73582-solved-dynamic-stylesheets/#findComment-371323 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.