• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
File Placement

#1
[eluser]georgerobbo[/eluser]
Where exactly should I place the CSS/Javascript? At the moment I have it in the root directory with index.php
However when I go http://10.0.0.6/igniter/index.php/welcome it can no longer find the stylesheet. When I am viewing the root it is /welcome.

#2
[eluser]Dam1an[/eluser]
The problem is the path is relative to the URI, although the following all take you to the same page, the relative paths are all differant
/
/welcome
/welcome/index

To get around this, use the base_url function in the URL helper (make sure to autoload it) as follows
Code:
<link rel="stylesheet" href="<?=base_url()?>css/reset.css" media="screen" type="text/css" />

That is assuming you have a css filder in your web root


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


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