Maracles Posted October 15, 2009 Share Posted October 15, 2009 I am working on a page and am using an 'include' for the header so that I don't have the code on every page. I have a problem however because the css stylesheets use on each page is chosen as part of the header code however I want to be able to use different stylesheets for some pages. This may be more of a CSS question but I was unsure, you're help would be much appreciated. Link to comment https://forums.phpfreaks.com/topic/177798-solved-can-you-use-a-header-include-but-with-different-stylesheets/ Share on other sites More sharing options...
cags Posted October 15, 2009 Share Posted October 15, 2009 whatever.php $stylesheet = "/css/style1.css"; include 'header.php'; header.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link rel="stylesheet" type="text/css" href="<?php echo $stylesheet; ?>" media="screen, projection, tv " /> </head> Link to comment https://forums.phpfreaks.com/topic/177798-solved-can-you-use-a-header-include-but-with-different-stylesheets/#findComment-937500 Share on other sites More sharing options...
Maracles Posted October 15, 2009 Author Share Posted October 15, 2009 That's worked wonders! Thanks for the help. Another one solved. Link to comment https://forums.phpfreaks.com/topic/177798-solved-can-you-use-a-header-include-but-with-different-stylesheets/#findComment-937507 Share on other sites More sharing options...
cags Posted October 15, 2009 Share Posted October 15, 2009 Took me awhile to figure that technique out Though admittedly I used it for title and meta values as opposed to stylesheets. Link to comment https://forums.phpfreaks.com/topic/177798-solved-can-you-use-a-header-include-but-with-different-stylesheets/#findComment-937512 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.