View Full Version : Linking php header template to css style sheet..?

02-24-2008, 07:02 PM
I have a php page with an include for a header template. The below is in the header.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<?php echo URL_PATH . 'style.css' ?>" rel="stylesheet" type="text/css" />

When I view source I can see it linking to the stylesheet but nothing is showing on the page.

02-24-2008, 07:11 PM
All variables have to have a '$' in front of it. Also, if you plan on only having one css sheet just make it:

<link rel="stylesheet" type="text/css" href="/style.css" />

As long as the style.css is in the root directory, every page will link back to the root directory.

02-24-2008, 09:55 PM
Can't figure out why my footer work but not my header.

<style type="text/css">
.header {
background-color: #0033GG;
.footer {
background-color: #0033FF;

02-24-2008, 10:01 PM
We need to see a link to your page to tell you why. Also this is more of a HTML/CSS problem.

Len Whistler
02-24-2008, 10:12 PM
Can't figure out why my footer work but not my header.

Since you are using an external style sheet that code should be in it, looks like you are putting it in the head section.


02-25-2008, 01:50 AM
yes I'm putting that in the head tags in the header section. I'm working on wampserver and don't have a live site.

02-25-2008, 05:00 AM
Then post your PARSED html, not the php.