Welcome Guest, Not a member yet? Register   Sign In
The style sheet for a view page can't be separated in an Includes folder?
#38

[eluser]Aken[/eluser]
So much discussion for such a simple problem... http://ellislab.com/forums/viewthread/214739/

1) You have an error notice for a missing $page_title variable. You should fix it or remove it, as unnecessary stuff in the header can affect output.

2) Don't use @import AND <link> for the same file, it's redundant and pointless. Use <link>.

3) The problem is you are still generating relative links (note there is no beginning / on the CSS URL). The web root for your localhost server is http://localhost/. You need to either use absolute URLs (ones that begin with a slash) and take your CI subdirectory into account, or use the base_url() helper.

/css/style.css = NO. This will look for http://localhost/css/style.css, which does not exist.
CI/css/style.css = NO. This will ADD this URL onto whatever URL is currently viewed. Given your example URL, it will effectively be looking for http://localhost/CI/index.php/welcome/in.../style.css.

Correct options:

Code:
<link href="/CI/css/style.css" rel="stylesheet" type="text/css" />

<link href="<?php echo base_url('css/style.css'); ?>" rel="stylesheet" type="text/css" />


Messages In This Thread
The style sheet for a view page can't be separated in an Includes folder? - by El Forum - 07-24-2012, 03:19 PM



Theme © iAndrew 2016 - Forum software by © MyBB