Welcome Guest, Not a member yet? Register   Sign In
Where do I place the CSS file(s) that I would like my application/pages to use ?
#1

[eluser]tobias eriksson[/eluser]
I've been searching and searching and don't seem to get any answer so here goes the question.

Where do I place the CSS file(s) that I would like my application/pages to use ?

There is no CSS directory or styles directory in the hierarchy.

/Tobias
#2

[eluser]Sarfaraz Momin[/eluser]
Hi,
CI directory structure is just for the application. What you can do is create an assets folder under application and CSS folder under assets so you have

CI
-- application
----assets
------css
------img
------js

and then you can use
Code:
APPPATH."assets/css/style.css"

simple isn't it.

Good Day !!!
#3

[eluser]Craig A Rodway[/eluser]
I make a www folder in the same directory as system
Code:
+ system
+ www
  + css
  + img
  + js

In your template/layout, you can use the <base> tag like this:

Code:
<base href="<?php echo $this->config->item('base_url') ?>www/" />

To load CSS:

Code:
<link rel="stylesheet" type="text/css" href="css/screen.css" media="screen,projection" title="Screen layout" />

Images:

Code:
<img src="img/header.jpg" />
#4

[eluser]tobias eriksson[/eluser]
Thanx but unfortunately it didn't work as smooth as I hoped :-(
I am using MACROMEDIA Dreamweaver, it uses the included the styles/CSS file from a path that is local and when I upload the file to the site then that path does not match the real structure as it is now relative to the application folder whereas the real structure is based off of the system folder.
/Tobias

Ps
Thanx for the increadbly quick response
Ds
#5

[eluser]Dr.Dan[/eluser]
Have you tried like this in view?

&lt;link rel="stylesheet" href="&lt;?=base_url()?&gt;css/file.css"&gt;

where css folder will be inside your project folder, and outside system folder.




Theme © iAndrew 2016 - Forum software by © MyBB