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

#3
[eluser]Bart v B[/eluser]
is it not easyer to make absolute paths?

What i always do, is work with the helper url.

in youre application/config/autoload.php

Code:
$autoload['helper'] = array('url');
in youre application/config/config.php
Code:
$config['base_url'] = "http://path to youre site/";

in youre view:
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="&lt;?php echo base_url();?&gt;css/main.css" rel="stylesheet" type="text/css" /&gt;
&lt;/head&gt;

Then it's alway's correct Wink


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-2020 MyBB Group.