ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Css Problem in IE

February 10, 2009 4:24am

Subscribe [2]
  • #1 / Feb 10, 2009 4:24am

    murtuza54

    13 posts

    Hi

    In my application css files are in css folder on root directory

    in header view
    i wrote
    <link type=“text/css” rel=“stylesheet” href=”/css/style.css”>

    so application runs well and fine in mozilla firefox with all css effects but fails in IE,
    means in IE css effects are not shown..

    in page source it displays the same as above..

    my question is how is it possible that firefox gets css correctly but not IE


    the other point..
    my image folder and javascript folder are also on root directory
    and i have given their path also like this..
    and their effects are shown well and fine in IE even..
    only problem is CSS…

    any help?

  • #2 / Feb 12, 2009 12:53am

    John_Betong

    690 posts

     
    Can you supply a link?

    Have you validated your source using:

      http://jigsaw.w3.org/css-validator/#validate_by_input+with_options

      http://validator.w3.org/

  • #3 / Feb 20, 2009 9:59am

    got 2 doodle

    171 posts

    I always use an absolute path to the CSS and I never have these kind of problems with any browser

    <link rel="stylesheet" type="text/css" href="http://localhost/jaybonnevie.ca/assets/css/site.css" />

    you have to pass the baseUrl to the view. In the view file it would look like this

    <link href="<?php echo"$base_url" ?>assets/css/tata.css" rel="stylesheet" type="text/css">

    I always assign the baseUrl in a model ,the value is initially defined in your
    /system/application/config/config.php

    In a controller you just need

    data['base_url' = $this->config->item('base_url')

    In a model I in a data array (that’s one way anyway).

    Lately I have been using an assets helper which is auto loaded.  The path to the CSS is defined in the config.php file. Here is a snippet that is defining multiple stylesheets and javascript files using the helper.

    /* style sheets */
    echo style('reset');
    echo style('text');
    echo style('960');
    echo style($css);
    /* javascript */
    echo jscript('prototype');
    echo jscript('scriptaculous.js?load=effects');
    echo jscript('lightbox');
    echo style('lightbox');

    notice that the last css file is defined in the controller and passed to the view, like this

    $data['css'] = "site";

    The asset helper is part of a package submitted by Gandy Labs search for GandyXT, it’s just been updated with some cool stuff.

    hope this helps
    doodle

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases