Problem linking the style sheet |
[eluser]stormlead[/eluser]
I have just created a simple page to start with. I wrote code as following: in config file: $config['base_url'] = "http://localhost/CodeIgniter_1.7.2/"; $config['css'] = "mystyle.css"; $config['index_page'] = "index.php"; then through routes file i call the welcome.php page which is as follows Code: I have just created a simple page to start with. I wrote code as following: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> also i have put the mystyle.css in CodeIgniter_1.7.2 folder. also i tried to put the mystyle.css in the views and other ways. but still the styles is not getting loaded. and output is plain default text. Can any one please HELP
[eluser]Niraj Dave[/eluser]
i am not sure but try Code: <link rel="stylesheet" type="text/css" href="<?php echo $base.'/'.$css;?>" />
[eluser]Phil Sturgeon[/eluser]
This a slightly over the top way of handling it. You don't need to output the base URL in front of it all as you can set that once in the header. Take a look at my "Asset handling in CodeIgniter with the BASE tag".
[eluser]stormlead[/eluser]
@NIRAJ i tried the way u showed but still not working the same output i am getting
[eluser]Niraj Dave[/eluser]
try in config change Code: $config['base_url'] = "http://localhost"; Code: function index() in view file Code: <link rel="stylesheet" type="text/css" href="<?php echo $base."/".$css;?>" /> and use Code: <?php echo $mytitle;?> instedof Code: <?php echo "$mytitle";?> |
Welcome Guest, Not a member yet? Register Sign In |