Welcome Guest, Not a member yet? Register   Sign In
Problems loading pictures, or CSS formatting if stored in a seperate file.
#1

[eluser]Marlonkj[/eluser]
I am a new-bee in using this framework, learned by watching the video tutorials. For some reason unknown to me, I am unable to load pictures in my CSS formatting when I load this frame-work using WAMP server. If I load the developed page using Aptana it works perfectly, but for some reason WAMP doesn't load the CSS pictures for this framework. If I store my CSS files separately (css definitions on a different file) I get the same result as well - they do not load, well this time nothing loads, no new fonts - nothing.

i renamed the codeigniter frame work to 'Four26Un'

path: C:\wamp\www\Four26Un
(base urlSmile http://localhost/Four26Un/

the css files are contained in the, 'Four26Un/views' with the .css extension.
and the images are in 'Four26Un/views/Images'

so if am loading an image, shouldn't "background-image:url('Images/h1.jpg');"
in the css document work?

Please help.
#2

[eluser]CroNiX[/eluser]
Don't use a relative path ('Images/h1.jpg').
#3

[eluser]Marlonkj[/eluser]
uuhhh.. I tried using an absolute path already, didn't work either. background-image:url(<?php echo base_url(); ?>'Images/h1.jpg');

#4

[eluser]CroNiX[/eluser]
I thought your images directory was in a directory named views? You don't use it in the image path. Also, if that is the views directory in the application directory, it won't work anyway. There is no direct access to that directory via the url.
#5

[eluser]CroNiX[/eluser]
Also, if your css is in a file, using php won't work unless you have your webserver setup to parse css files as php files, so base_url() obviously won't work there.
#6

[eluser]InsiteFX[/eluser]
Your directory structure should be like this!
Code:
application
system
assets - for css, images and js
index.php

The CodeIgniter directories are protected with .htaccess files!

As CroNiX mentioned to you above...

Also you need this in your.htaccess file
Code:
RewriteCond $1 !^(index\.php|assets|css|js|images|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ index.php/$1 [L]
#7

[eluser]Marlonkj[/eluser]
hmm... Thanks for the prompt response.




Theme © iAndrew 2016 - Forum software by © MyBB