Welcome Guest, Not a member yet? Register   Sign In
Stylesheet
#1

[eluser]Jesse2303[/eluser]
Hi all

When I include my stylesheet he don't load my stylesheet..
Is there a special place for putting the stylesheet ?

This is main_view.php
Code:
<html>
<head>
<title><?=$title?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" media="screen" href="http://127.0.0.1:8080/ciAdmin/system/application/views/style.css" />
</head>
<body>
<div id="content">
<h1>
    &lt;?php
        if(isset($_SESSION['gebruiker'])){
    ?&gt;
            admin <a href="index.php?pagina=admin/main">begin</a>
                - <a href="index.php?pagina=login">uitloggen</a>  
            modules <a href="index.php?pagina=admin/scripts">pictures</a>
                  - <a href="index.php?pagina=admin/nieuws">nieuws</a>
    &lt;?php
        }
            else
        {
    ?&gt;
            gast <a href="index.php">begin</a> - <a href="index.php?pagina=login">login</a> - <a href="index.php?pagina=contact">contact</a>
    &lt;?php
        }
    ?&gt;
</h1>

<h1>&lt;?=$copyrights?&gt;</h1>
</div>
&lt;/body&gt;
&lt;/html&gt;

main.php
Code:
&lt;?php

/**
* @author Jesse
* @copyright 2008
* @created 23-6-2008
* @filename main.php
*/

class Main extends Controller {
    
    function index() {
        
        $data['title'] = 'iAdmin';
        $data['copyrights'] = 'Imagine Works 2008 - 20..';
        
        $this->load->view('main_view', $data);
        
    }
    
}



?&gt;

Thanks
#2

[eluser]Dagobert Renouf[/eluser]
I could be wrong, but with an absolute path like this, the only thing that can block access to your css file is a wrong path, so check it twice.

Here's how I did it in case that's a strange problem and your path is good :


Code:
&lt;?php echo link_tag('system/application/views/stylesheet.css'); ?&gt;
You need the HTML Helper for this.
#3

[eluser]Jesse2303[/eluser]
[quote author="Dagobert Renouf" date="1214261759"]I could be wrong, but with an absolute path like this, the only thing that can block access to your css file is a wrong path, so check it twice.

Here's how I did it in case that's a strange problem and your path is good :


Code:
&lt;?php echo link_tag('system/application/views/stylesheet.css'); ?&gt;
You need the HTML Helper for this.[/quote]

It works, Thanks
#4

[eluser]daulex[/eluser]
[quote author="Jesse2303" date="1214261969"][quote author="Dagobert Renouf" date="1214261759"]I could be wrong, but with an absolute path like this, the only thing that can block access to your css file is a wrong path, so check it twice.

Here's how I did it in case that's a strange problem and your path is good :


Code:
&lt;?php echo link_tag('system/application/views/stylesheet.css'); ?&gt;
You need the HTML Helper for this.[/quote]

It works, Thanks[/quote]
the full path is right, as it says in the manual: dont use relative url's, so for the sake of it, I advise you to use &lt;?=base_url()?&gt; or &lt;?=site_url()?&gt; like this:

Code:
&lt;link rel="stylesheet" type="text/css" href="&lt;?php echo site_url(); ?&gt;css/style.css" media="screen, print" /&gt;

and it returns: (aso is down Sad ) it returns something on the lines of:
Code:
&lt;link rel="stylesheet" type="text/css" href="http://host/css/style.css" media="screen, print" /&gt;


This may be long and maybe even useless, but an absolute url makes sure that the css always loads Big Grin




Theme © iAndrew 2016 - Forum software by © MyBB