当我正常运行html bootstrap启用代码时,它显示正确的输出但是当我使用codeigniter视图加载它时它显示不同的输出

This is my directory:

miuse/application  
miuse/application/views/templates/header.php    
miuse/bootstrap/css  
miuse/bootstrap/js  
miuse/bootstrap/fonts  

This is my controller code:

<?php
    class page extends CI_controller{
        public function view($page= 'home')
        {
            if(!file_exists(APPPATH.'views/pages/'.$page.'.php'))
            {
                show_404();
            }
                $data['title']='Moodlist home';
                $this->load->view('templates/header', $data);
            }
    }
?>

This is my view code:

<!DOCTYPE html>
<html lang="en">
<head>
<title>
    <?php echo $title; ?>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" href="http://localhost/miuse/bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="header.css" type="text/css">

</head>
<body>
<header class="container">
<div class="row">
<h1 class="col-sm-4">List</h1>
        <nav class="col-sm-8 text-right">
            <p>Home</p>
            <p>Category</p>
            <p>About us</p>
        </nav>
    </div>
</header>
</body>
</html>  

when i run my view normally in a browser it shows proper output but when i load it with codeigniter view then it shows different output which i dont want.

I guess your header.css file is not being loaded.

Put the header.css file in miuse/bootstrap/css directory.

And change your code from,

<link rel="stylesheet" href="header.css" type="text/css">

to

<link rel="stylesheet" href="http://localhost/miuse/bootstrap/header.css" type="text/css">

When loading css and other stuff I would recommend using base_url() in your head area

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

Make sure you have set the base url in config.php and autoload the url helper.