phphtmlcsscodeigniterweb-inspector

CSS external links are displayed inside body tag instead of head tag


Am giving all my css external links inside the head tag.But when I inspect the webpage all css links are appeared inside the body tag instead of displayed in head tag.What am doing wrong?


Solution

  • In your base url in links in head you have double quotes "" because you have double quotes all ready wrapped around it use single quotes inside base_url('')

    href="<?php echo base_url("something.css");?>"
    

    change like to single quote in base url

    href="<?php echo base_url('something.css');?>"
    

    Make sure you autoload the url helper config/autoload.php

    Also make sure you have set your base url in config.php IS A MUST

    $config['base_url'] = 'http://localhost/projectname/';
    

    Or a domain some thing like

    $config['base_url'] = 'http://www.example.com/';