css include problem

Discussion in 'CSS' started by darcrc, May 5, 2007.

  1. #1
    I have a problem with including css files to my on my .htaccess using pages.

    For example I have my css file at root/images/ilike.css
    I have header and footer files at root/inc/header.php or footer.php
    and in the header I include my css file.

    and I have articles.php
    in articles php I call header.php like this
    <?
    require_once("inc/header.php");
    ?>

    I'm showing articles with this style www.myurl.com/articles/category/name.html

    but It doesnt work. I can see header file but without my style.
    When I create directory structure like in .htaccess it works.
    For instance /articles/category/images/ilike.css works but I can not create a directory myself for all my .htaccess names.

    I tried to include css file like "../../images/ilike.css" bu it didnt work either.
    What can I do?

    Thanks in advance.
     
    darcrc, May 5, 2007 IP
  2. Mr Blonde

    Mr Blonde Guest

    Messages:
    142
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    have u tried making the path server relative. eg: href="/images/ilike.css" ?
     
    Mr Blonde, May 5, 2007 IP
  3. clicyu

    clicyu Peon

    Messages:
    22
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    add it in html pages where u wanna use it like:
    <link rel="stylesheet" href="/images/ilike.css" type="text/css" />
    in <head> section...

    Or try @import command..
    The @import rule links to an external stylesheet from within a stylesheet
    @import url('/images/ilike.css');
    this line you will need to put on top of some .css file what u currently use it and is working.
     
    clicyu, May 6, 2007 IP