Can't get css to work - 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: Can't get css to work (/showthread.php?tid=59745) |
Can't get css to work - El Forum - 11-11-2013 [eluser]cerberus478[/eluser] Hi I'm not sure if this is the right forum, but for some reason my css doesn't want to work. I think I'm doing something silly but I can't seem to figure it out. I'm using MAMP as my localhost. Code: <!DOCTYPE html> Can't get css to work - El Forum - 11-12-2013 [eluser]CroNiX[/eluser] Either of these 2 should work: Code: <link href="/css/style.css" rel="stylesheet"> Assuming: -/application -/css -/system -index.php Notice the CSS dir is in the root dir of the site and not within /application or /system. Can't get css to work - El Forum - 11-12-2013 [eluser]vamsisnikky[/eluser] use <?php $this->load->helper('url'); ?> <link href="<?php echo base_url(); ?>css/style.css" rel="stylesheet"> You have to lode helper('url') then only base_url(); works this will defanatly gets ur css |