Stylesheet - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Stylesheet (/showthread.php?tid=9375) |
Stylesheet - El Forum - 06-23-2008 [eluser]Jesse2303[/eluser] Hi all When I include my stylesheet he don't load my stylesheet.. Is there a special place for putting the stylesheet ? This is main_view.php Code: <html> main.php Code: <?php Thanks Stylesheet - El Forum - 06-23-2008 [eluser]Dagobert Renouf[/eluser] I could be wrong, but with an absolute path like this, the only thing that can block access to your css file is a wrong path, so check it twice. Here's how I did it in case that's a strange problem and your path is good : Code: <?php echo link_tag('system/application/views/stylesheet.css'); ?> Stylesheet - El Forum - 06-23-2008 [eluser]Jesse2303[/eluser] [quote author="Dagobert Renouf" date="1214261759"]I could be wrong, but with an absolute path like this, the only thing that can block access to your css file is a wrong path, so check it twice. Here's how I did it in case that's a strange problem and your path is good : Code: <?php echo link_tag('system/application/views/stylesheet.css'); ?> It works, Thanks Stylesheet - El Forum - 06-23-2008 [eluser]daulex[/eluser] [quote author="Jesse2303" date="1214261969"][quote author="Dagobert Renouf" date="1214261759"]I could be wrong, but with an absolute path like this, the only thing that can block access to your css file is a wrong path, so check it twice. Here's how I did it in case that's a strange problem and your path is good : Code: <?php echo link_tag('system/application/views/stylesheet.css'); ?> It works, Thanks[/quote] the full path is right, as it says in the manual: dont use relative url's, so for the sake of it, I advise you to use <?=base_url()?> or <?=site_url()?> like this: Code: <link rel="stylesheet" type="text/css" href="<?php echo site_url(); ?>css/style.css" media="screen, print" /> and it returns: (aso is down ) it returns something on the lines of: Code: <link rel="stylesheet" type="text/css" href="http://host/css/style.css" media="screen, print" /> This may be long and maybe even useless, but an absolute url makes sure that the css always loads |