• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem with css

Hi guys
I have problem with css .I have a css file ,i am including that file to my view page (<link type="text/css" href="/css/cupertino/jquery-ui.css" rel="Stylesheet" /> )but i didn't get any style .i am facing problem can any one help me.

Thanks in advanced.

I`m always looking for such a problem like this: (I`m using Chrome )

1. ctrl+u to view page source
2. then you can click on the link which should provide you to the css file -> should occur in new tab
3. if not you have wrong path to it

if you refer to css file like href=”/css/cupertino/jquery-ui.css”
you should have proper entry in htaccess and of course use base_url()

so, href=”<?php echo base_url(); ?>css/cupertino/jquery-ui.css”

Hi Krystian
Thanks for reply. I put the outside of application folder,that getting style.I put the CSS file in the application folder,I included the css file but i didn't get the style.Can you help me.

Thanks in advanced.

You cannot place resouce files under the application directory there is an .htaccess file that stops access to the files!

CodeIgniter Structure:
-- css
-- js
-- images
-- etc

// HTML helper code:
    <base href="<?php echo base_url();?>" />

    <link type="text/css" href="<?php echo base_url('styles.css); ?>" rel="stylesheet" media="screen" />

// HTML Helper code for js - Replace $ with s in script tags!
<$cript type="text/javascript" charset="utf-8">
        var base_url = "&lt;?php echo base_url(); ?&gt;";
        var site_url = "&lt;?php echo site_url(); ?&gt;";
    // ]]>

Hi InsiteFX,
Thanks for reply.
I put the as follow


Can you help how to give the path to include the css file or is this correct way put the css .

Thanks in advanced.

I`m always put the css folder at the same level as application folder.
then in htaccess
RewriteCond $1 !^(index\.php|css|js|images|robots\.txt|favicon\.ico)

and then href=”&lt;?php echo base_url(); ?&gt;css/cupertino/jquery-ui.css”

All of these should be on the same directory level, place your css, images and js folders inside the assets folder

ROOT - Application
ROOT - assets
ROOT - system
ROOT - index.php

// CSS link:
    &lt;base href="&lt;?php echo base_url();?&gt;" /&gt;

    &lt;link type="text/css" href="&lt;?php echo base_url('assets/styles.css); ?&gt;" rel="stylesheet" media="screen" /&gt;

// if you set the base href like on the first line in the head tag then you can use a link like this
    &lt;link type="text/css" href="assets/styles.css" rel="stylesheet" media="screen" /&gt;

Thanks for clarifying my doubt .......

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.