how to load the css |
[eluser]darshanchalla[/eluser]
Hi, My page is not able to load the css when i am trying to load the page with default controller like this way http://localhost/mysite/ like this way css is not loaded...... when i am trying to load the page like this way http://localhost/mysite/index.php/site/index css is loaded perfectly.....and i have put all my css folder and image folder like in this path C:\wamp\www\tt\assets\css and all other application path is in the root path of the tt like c:\wamp\www\tt\application....plz give me solution as
[eluser]Metamorphosis[/eluser]
Hi. try this in your header.php Code: <link href="<?php echo base_url();?>assets/css/name_of_css_file.css" rel="stylesheet" type="text/css" />
[eluser]PhilTem[/eluser]
Or try it more fail-safe Code: <link href="<?php echo base_url('assets/css/name_of_css_file.css');?>" rel="stylesheet" type="text/css" /> Many people seem to forget that base_url() and site_url() take an argument that will be taken care of leading slashes and stuff so you don't run into troubles with that ![]()
[eluser]Otemu[/eluser]
[quote author="PhilTem" date="1359027820"]Or try it more fail-safe Code: <link href="<?php echo base_url('assets/css/name_of_css_file.css');?>" rel="stylesheet" type="text/css" /> Many people seem to forget that base_url() and site_url() take an argument that will be taken care of leading slashes and stuff so you don't run into troubles with that ![]() Fantastic I didn't even know that :-)
[eluser]darshanchalla[/eluser]
[quote author="PhilTem" date="1359027820"]Or try it more fail-safe Code: <link href="<?php echo base_url('assets/css/name_of_css_file.css');?>" rel="stylesheet" type="text/css" /> Many people seem to forget that base_url() and site_url() take an argument that will be taken care of leading slashes and stuff so you don't run into troubles with that ![]() thank you very much to all of u ![]() |
Welcome Guest, Not a member yet? Register Sign In |