![]() |
Can not load css and image file in assets ? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Can not load css and image file in assets ? (/showthread.php?tid=43178) |
Can not load css and image file in assets ? - El Forum - 07-03-2011 [eluser]ryantran[/eluser] My structure is : - assets - public - css - images - admin - mysite - application - system In controller file : Code: $data['css']['style'] = $this->assets->load('style.css'); In view file : Code: {$css['style']} // smarty code My problems are : 1. CSS file did not linked. 2. Image did not load. When i show my code in browser : Code: <img src='http://localhost/mysite/assets/public/imageslogo.png' /> - Between Folder link and file link has not "/". How to add it ? (I tried to add in "/" font of file name in controller but i do not think that is a good solution ![]() Plz help me ? Thanks again ! ^ ^ PS/ Sry, if i posted many. (I have recent post in Wiki Artical Discussions) Can not load css and image file in assets ? - El Forum - 07-03-2011 [eluser]InsiteFX[/eluser] Code: <base href="<?php echo base_url();?>"> Or Code: <link type="text/css" rel="stylesheet" href="<?php echo site_url();?>assets/css/styles.css"> InsiteFX Can not load css and image file in assets ? - El Forum - 07-03-2011 [eluser]ryantran[/eluser] Thanks pro ! I fixed image link. But css file have not yet. In my code on browser i see my problem is Code: <head> I do not understant why that code appered in <body></body> although i placed it in <head></head> ? Can not load css and image file in assets ? - El Forum - 07-03-2011 [eluser]InsiteFX[/eluser] Your CSS link needs to go in the <head> </head> tags! Code: base href="<?php echo base_url();?>"> InsiteFX |