Welcome Guest, Not a member yet? Register   Sign In
loading style.css how do you do that ?
#1

[eluser]number1chump[/eluser]
Hello,

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:

Code:
function showfrontpage()
    {   $this->load->view('includes/style.css');
        $this->load->view('includes/header.html');
        $this->load->view('frontpage');
        $this->load->view('includes/footer.html');
        
        
    }


The baffling problem is that in the Header, there is also a
Code:
<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 ?

thanks

Al
#2

[eluser]BrokenLegGuy[/eluser]
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/

Ed
#3

[eluser]toopay[/eluser]
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.




Theme © iAndrew 2016 - Forum software by © MyBB