Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Jan 2008
    Posts
    12
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Linking php header template to css style sheet..?

    I have a php page with an include for a header template. The below is in the header.php
    PHP Code:
    <!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.

  • #2
    Regular Coder
    Join Date
    Nov 2005
    Location
    North Canton, Ohio
    Posts
    118
    Thanks
    11
    Thanked 4 Times in 4 Posts
    All variables have to have a '$' in front of it. Also, if you plan on only having one css sheet just make it:
    Code:
    <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.
    Last edited by Blaher; 02-24-2008 at 06:13 PM.

  • #3
    New Coder
    Join Date
    Jan 2008
    Posts
    12
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Can't figure out why my footer work but not my header.

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

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    We need to see a link to your page to tell you why. Also this is more of a HTML/CSS problem.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    Senior Coder Len Whistler's Avatar
    Join Date
    Jul 2002
    Location
    Vancouver, BC Canada
    Posts
    1,323
    Thanks
    26
    Thanked 100 Times in 100 Posts
    Quote Originally Posted by javanoobie9 View Post
    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.



    -------------
    Leonard Whistler

  • #6
    New Coder
    Join Date
    Jan 2008
    Posts
    12
    Thanks
    6
    Thanked 0 Times in 0 Posts
    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.

  • #7
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Then post your PARSED html, not the php.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •