css problems - 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: css problems (/showthread.php?tid=11500) |
css problems - El Forum - 09-10-2008 [eluser]kkoncept[/eluser] I did a search and saw several threads that came close to answering my question but didn't quite get there. I'm trying to link to an external style sheet with the following code in my view file using base_url(): Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> My directory structure is Code: /public_html and my controller code is this: Code: <?php Everything seems to be working except that the css isn't getting applied. As you can see, I am using the same technique to link to my images folder. The weird part is that it works for the images folder but not the css folder. Could the problem be in the css file itself? The code for that is here: Code: #header { Thanks in advance for any enlightenment. css problems - El Forum - 09-10-2008 [eluser]spider pig[/eluser] You need to change the links to images in your CSS: Code: #header { Also, if you are using .htaccess to rewrite the URLs, make sure you include the css and images sub-directories: Code: RewriteEngine on css problems - El Forum - 09-10-2008 [eluser]kkoncept[/eluser] [quote author="spider pig" date="1221120539"]You need to change the links to images in your CSS: Code: #header { Also, if you are using .htaccess to rewrite the URLs, make sure you include the css and images sub-directories: Code: RewriteEngine on Thanks for the quick reply. I'm not using .htaccess to rewrite the URLs. Also, I tried it both ways as: Code: #header { and: Code: #header { It doesn't work either way. Also, it isn't just the background image that isn't working. None of the CSS formatting is working. This leads me to believe that for some reason my view isn't finding the CSS file. css problems - El Forum - 09-10-2008 [eluser]kkoncept[/eluser] I figured it out and feel pretty stupid because it was a newbie mistake and I am far from a newbie: the difference is that this: Code: <div class="header"><img src="<?php echo base_url();?>images/logo.gif" alt="LOGO" /></div> Should be this: Code: <div id="header"><img src="<?php echo base_url();?>images/logo.gif" alt="LOGO" /></div> using "id" instead of "class". So, not a CI issue at all but just an example of me making things more complicated than they really are. |