• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
loading style.css how do you do that ?


I am going nuts with an issue.

I am loading all the stuff from the Controller, and that includes the style.css, the header page, the content page and the sidebar section, the footer etc.

So, I d be doing like:

function showfrontpage()
    {   $this->load->view('includes/style.css');

The baffling problem is that in the Header, there is also a
<link href="style.css" rel="stylesheet" type="text/css" />

And then, what happens is that the first include, displays me Unparsed all the css code, then the header below does use that css and does the correct formatting but that unparsed css code stays at the top of the page while the rest of the page is correctly formatted. So there is a duplicate use of that style.css. The one that I load, and the one that the header links to.

So you would say, well just remove the link ref from the Header. Nope. If I do that, the first chunk of css code stays where it was, plus the rest of the page now is unformatted.

So then you would say, ok, then just remove the load->view->('includes/style.css'); so that you will not see the unparsed code. Nope. If I do that, then the header does not format the rest of the page, nothing is unformatted.

So, this is a case of damned if I do, damned if I dont.

Yes, I could paste the whole css code in the header file and remove all the calls, but I dont want a half a meter page clogged with rubbish style sheet which should be loaded from a separate file.

So, how do you load a style.css that is to act on a page without having this baffling problems ?



loading css - http://ellislab.com/codeigniter/user-gui...l#link_tag

and just a suggestion for loading multiple views (I use the first method)- http://codeigniter.com/wiki/Displaying_Multiple_Views/


using codeigniter html helper class as your solution, isn't bad idea. But, you should try to thinking about using some templating technique. It will be more efficient, and more easy to use.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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