• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem loading CSS file with relative path

#1
[eluser]mihaibaboi[/eluser]
Hello,

I hope I'm not starting a new topic for nothing. I had a look around and couldn't find anything that matches my problem. I guess it's a very trivial problem, but there's something I'm missing. Here's the problem. I've set up CodeIgniter like this:

D:\work\php\www\codeigniter\ (where "D:\work\php\www\" is the document root on my local server)

I have a view file located at D:\work\php\www\codeigniter\system\application\views\layout.php

I want to set up an external css file that's located in D:\work\php\www\codeigniter\system\application\views\css.main.css

To do that wrote:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
&lt;html &gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
&lt;title&gt;My layout page&lt;/title&gt;
&lt;link href="css/main.css" rel="stylesheet" type="text/css" /&gt;
&lt;/head&gt;

The problem is that it refuses to apply the styles that I wrote in my css file, and when I inspect it with FireBug, the &lt;link&gt; tag has a 404 error. I also tried writing it like this:

Code:
&lt;link href="system/application/views/css/main.css" rel="stylesheet" type="text/css" /&gt;

because I figured that it would be relative to the index.php file in the codeigniter folder. It didn't work. Any ideas?

Sorry for the long post, but I wanted to provide you with all the details that I thought might help.

Thanks


Messages In This Thread
Problem loading CSS file with relative path - by El Forum - 04-09-2010, 02:29 PM
Problem loading CSS file with relative path - by El Forum - 04-09-2010, 05:32 PM
Problem loading CSS file with relative path - by El Forum - 04-10-2010, 12:35 AM
Problem loading CSS file with relative path - by El Forum - 04-10-2010, 01:25 AM
Problem loading CSS file with relative path - by El Forum - 04-10-2010, 02:27 AM
Problem loading CSS file with relative path - by El Forum - 04-10-2010, 02:50 AM
Problem loading CSS file with relative path - by El Forum - 04-26-2010, 01:50 AM
Problem loading CSS file with relative path - by El Forum - 04-26-2010, 01:55 AM
Problem loading CSS file with relative path - by El Forum - 04-26-2010, 02:02 AM
Problem loading CSS file with relative path - by El Forum - 04-26-2010, 04:10 AM
Problem loading CSS file with relative path - by El Forum - 04-26-2010, 04:30 AM
Problem loading CSS file with relative path - by El Forum - 04-26-2010, 04:35 AM
Problem loading CSS file with relative path - by El Forum - 04-26-2010, 10:26 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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