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

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 it can no longer find the stylesheet. When I am viewing the root it is /welcome.

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

To get around this, use the base_url function in the URL helper (make sure to autoload it) as follows
<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.