#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    152
    Rep Power
    12

    CSS file not being recognized by all pages


    Im trying to figure out why some of my pages utilize my CSS file and others don't when I have the same path to the file in both pages. The CSS works fine on my index page, but when I try to open another page on the site, everything in my CSS is ignored. This only happens on one or two pages. Can someone give me an idea where to look please? Thanks in advance for you help.
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2002
    Location
    Barcelona
    Posts
    133
    Rep Power
    12
    can u post some code or a link? there are too many instances why your code wouldnt work.
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    152
    Rep Power
    12
    Sorry, this is my header.inc file

    <html>
    <head>
    <title></title>


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




    </head>


    <body bgcolor="efefef">
    <h3><center>BCE Service Tech Resource Site</center></h3>
    <table width=700 align="center" background="./images/cellpic1.gif">



    <tr>
    <td><a href="../index2.php">Home</a> |</td>
    <td><a href="../manuals.php">Service Manuals</a> |</td>
    <td><a href="../firmware.php">Firmware</a> |</td>
    <td><a href="../parts.php">Parts Price List</a> |</td>
    <td><a href="../forms.php">BCE Forms</a> |</td>
    <td><a href="../expenses/expenses.php">Expenses</a> |</td>
    <td><a href="../forum/index.php" target="new">Tech Forums</a> |</td>
    <td><a href="../fss/fss.php">FSS</a> |</td>
    <td><a href="../links.php">Links</a></td>
    </tr>
    </table>
    <hr>

    Thanks for your help./
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2002
    Location
    Barcelona
    Posts
    133
    Rep Power
    12
    is that other page (not index) in a different folder? I'd recommend using absolute paths, like:

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

    first / in href tells browser to look from the root of your html pages.
  8. #5
  9. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    152
    Rep Power
    12
    yes, my css is in another folder. what if I want to keep my include file outside my html root folder?
    Last edited by spank; July 22nd, 2003 at 11:37 AM.
  10. #6
  11. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2002
    Location
    Barcelona
    Posts
    133
    Rep Power
    12
    if you follow my example above, if you place all your css files in, for instance, css folder, you would call it like:
    <link rel="stylesheet" href="/css/includes/style.css" type="text/css">
    from all your pages, and it'd work always, as it's absolute path. It's the same as calling
    <link rel="stylesheet" href="http://www.yourdomain.com/css/includes/style.css" type="text/css">
  12. #7
  13. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    152
    Rep Power
    12
    OK, Thanks for your help. I appreciate your time.

IMN logo majestic logo threadwatch logo seochat tools logo