• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to load the css

#1
[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

#2
[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" />

#3
[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 Wink

#4
[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 Wink[/quote]

Fantastic I didn't even know that :-)

#5
[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 Wink[/quote]





thank you very much to all of u Big Grin


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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