Welcome Guest, Not a member yet? Register   Sign In
img/CSS relative path problem
#2

[eluser]Craig A Rodway[/eluser]
This is what I do in the HEAD tag of my main template:


Code:
<base href="<?php echo $this->config->item('base_url') ?>web/" />
<link rel="stylesheet" type="text/css" media="all" href="css/style.css" />

This is my directory structure:

Code:
- index.php
- system
- web
  + css
  + img
  + js

So http://server/ci/ is the CI installation. The BASE tag sets the location to the CI installation then the web/ sub-folder. All CSS, Javascripts and images are loaded relative to that.

Example:
Code:
<img src="img/foobar.jpg" />


Messages In This Thread
img/CSS relative path problem - by El Forum - 12-22-2009, 01:48 PM
img/CSS relative path problem - by El Forum - 12-22-2009, 01:50 PM
img/CSS relative path problem - by El Forum - 12-22-2009, 02:03 PM
img/CSS relative path problem - by El Forum - 12-22-2009, 02:15 PM
img/CSS relative path problem - by El Forum - 12-22-2009, 02:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB