• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot load CSS, loads inside HTML tags

Why are you including "index.php" in the url to your assets? They are regular files which aren't processed via CI...

So it's trying to access one of your CI controllers, which obviously doesn't exist and you get the 404.

Try just using
<link rel="stylesheet" href="/assets/css/basicLayout2.css" type="text/css" media="screen, projection" />

[eluser]TWP Marketing[/eluser]
I think CroNix nailed it.

You'd need to post your .htaccess if that doesn't work.
Also, echo out the $_SERVER array from the top of your index.php and post the results.

I'd highly recommend looking into how to set up a virtual server in Apache so each of your projects would have it's own DOCUMENT_ROOT and also have a unique url that doesn't include the "project" directory, like "http://myproject.localhost", instead of "http://localhost/myproject". It also saves a LOT of time when developing/troubleshooting, as your working environments will be the same on both servers, your htaccess will be the same, your CI configs, etc.

Guys problem solved!! I used this:

<link rel=stylesheet href="<?php echo base_url(); ?>assets/css/basicLayout2.css" type="text/css" media="screen, projection">

It just needed the 'media' thing. Oh such a problem wasted 3 days!!

Thank you for your time. I'll come back with new questions on CI.

The media parameter is not required for CSS. It will automatically apply to all if it is not specified. Not sure why that would've been your problem... You should also have double quotes around your rel="stylesheet".

ops close!

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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