html - PHP Codeigniter wont load CSS-File -
good evening,
i started using codeigniter framework newest projekt... , got problems on first page.
i want link css file site. looks in code. nothing happens.
<html> <head> <title>tec.net</title> <?php $this->load->helper('html'); echo link_tag($data['css']); ?> </head> <body> <h1><?php echo $title ?></h1>
this code of header.php
body { background-image: url("application/views/images/console background.png"); color: white; }
the standard.css
<html> <head> <title>tec.net</title> <link href="localhost/tecnet/standard.css" rel="stylesheet" type="text/css" /> </head> <body> <h1>home</h1> <h2>this home site</h2> <em>© 2015</em> </body> </html>
and @ last. code receive firefox. link fine. if try access directly browser opens css file. inline css code works perfect link refuses work
edit: url structure controller.
http://localhost/tecnet/index.php/tecnet/view
and controller itself
<?php class tecnet extends ci_controller { public function view($page = 'home') { if ( ! file_exists(apppath.'/views/pages/'.$page.'.php')) { // whoops, don't have page that! show_404(); } $data['title'] = ucfirst($page); // capitalize first letter $this->load->view('templates/header', $data); $this->load->view('pages/'.$page, $data); $this->load->view('templates/footer', $data); } } ?>
try load style sheet this:
<link rel="stylesheet" href="<?= base_url('tecnet/standard.css') ?>">
Comments
Post a Comment