Jump to content

[SOLVED] Can you use a header 'include' but with different stylesheets?


Maracles

Recommended Posts

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.

 

 

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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.