Welcome Guest, Not a member yet? Register   Sign In
problem with css
#1

[eluser]naveen27[/eluser]
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.
#2

[eluser]Krystian[/eluser]
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”
#3

[eluser]naveen27[/eluser]
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.
#4

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

CodeIgniter Structure:
Code:
application
assets
-- css
-- js
-- images
-- etc
system
index.php

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

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

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

[eluser]naveen27[/eluser]
Hi InsiteFX,
Thanks for reply.
I put the as follow

Application
css
-style.css
system
index.php


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

Thanks in advanced.
#6

[eluser]Krystian[/eluser]
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”
#7

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

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

// CSS link:
&lt;head&gt;
    &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;
&lt;/head&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;
#8

[eluser]naveen27[/eluser]
Thanks for clarifying my doubt .......




Theme © iAndrew 2016 - Forum software by © MyBB