problem with putting css style |
[eluser]Dennis Rasmussen[/eluser]
[quote author="victorche" date="1285691522"]I am more of a html/css/js guy, than a programmer and I really can not understand why everybody here is speaking about echo, asset management library, <?php echo $css; ?> In my case I have one main template.php file in /views/ folder and my links to the css files are ... how can I say ... hardcoded in this template. The old, normal, working way. So instead of base_url() and other stuff ... just make one directory in your webroot dir. Call it /theme/ or /assets/ or whatever you like, and put the styles and images there. and then call it in a normal way, not using C:\XAMPP or http://localhost/... Use relative paths. This way the application will be more portable. Think how many lines in different files you have to change, when moving to a real hosting/domain. All this "localhost" stuff should be changed then. What is so hard in adding a simple line in your <head></head> section? Yeah, does not look so ... guru made, programming maniac style, but it works. Try with: Code: <link rel="stylesheet" href="/theme/styl.css" type="text/css" media="screen" /> You make no sense. The point of using base_url() is NOT having to change it everywhere when shipping/moving your application/website since base_url() prints out the domain of your application giving you a dynamic view file. Hardcoding is what you don't want to do. Edit: I've got a question related to this post though. What if you run more than 1 application and need different types of stylesheets (basically any asset file) for each application? Wouldn't that make sense to have this located inside the actual application? |
Messages In This Thread |
problem with putting css style - by El Forum - 09-27-2010, 09:17 AM
problem with putting css style - by El Forum - 09-27-2010, 11:15 PM
problem with putting css style - by El Forum - 09-28-2010, 01:04 AM
problem with putting css style - by El Forum - 09-28-2010, 01:12 AM
problem with putting css style - by El Forum - 09-28-2010, 01:18 AM
problem with putting css style - by El Forum - 09-28-2010, 01:42 AM
problem with putting css style - by El Forum - 09-28-2010, 03:14 AM
problem with putting css style - by El Forum - 09-28-2010, 05:32 AM
problem with putting css style - by El Forum - 09-28-2010, 07:39 AM
problem with putting css style - by El Forum - 09-28-2010, 07:49 AM
problem with putting css style - by El Forum - 09-28-2010, 08:03 AM
problem with putting css style - by El Forum - 09-28-2010, 08:29 AM
problem with putting css style - by El Forum - 09-28-2010, 08:58 AM
problem with putting css style - by El Forum - 09-28-2010, 10:30 PM
problem with putting css style - by El Forum - 09-29-2010, 08:42 AM
problem with putting css style - by El Forum - 09-30-2010, 04:10 PM
problem with putting css style - by El Forum - 10-05-2010, 12:13 AM
problem with putting css style - by El Forum - 10-05-2010, 12:34 AM
problem with putting css style - by El Forum - 10-05-2010, 03:27 AM
problem with putting css style - by El Forum - 10-05-2010, 05:35 AM
problem with putting css style - by El Forum - 10-18-2010, 10:20 AM
|