...

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



javanoobie9
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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>mypage</title>
<link href="<?php echo URL_PATH . 'style.css' ?>" rel="stylesheet" type="text/css" />
</head>


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

Blaher
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.

javanoobie9
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;
}
</style>

_Aerospace_Eng_
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.



-------------

javanoobie9
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.

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum