Welcome Guest, Not a member yet? Register   Sign In
Bootstrap.css not working
#3

For one you should create an assets folder and place all of you css and js in to it.

This is for an assets folder along with the index.php

PHP Code:
<!DOCTYPE html>
<
html lang="en">

<
head>

    <
meta charset="utf-8">
    <
meta http-equiv="X-UA-Compatible" content="IE=edge">
    <
meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 
The above 3 meta tags *mustcome first in the headany other head content must come *afterthese -->

    <
base href="<?php echo base_url(); ?>">

    <
meta name="description" content="">
    <
meta name="keywords" content="">
    <
meta name="author" content="">

    <
title>Home</title>

    <!-- 
favicon -->
    <
link rel="icon" href="<?php echo base_url('assets/favicon.ico'); ?>">

    <!-- 
Bootstrap CSS file -->
    <
link href="<?php echo base_url('assets/bootstrap/css/bootstrap.min.css'); ?>" rel="stylesheet">
    <
link href="<?php echo base_url('assets/bootstrap/css/bootstrap-theme.min.css'); ?>" rel="stylesheet">

    <!-- 
HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if 
lt IE 9]>
    <
script src="<?php echo base_url('assets/js/html5shiv/html5shiv.min.js'); ?>"></script>
    <
script src="<?php echo base_url('assets/js/respond/respond.min.js'); ?>"></script>
    <![endif]-->

    <!-- 
Pass base_url() and site_url() to JavaScript -->
    <
script>
        var 
baseUrl "<?php echo base_url(); ?>";
        var 
siteUrl "<?php echo site_url(); ?>";
    </
script>

</
head>

<
body

Notice the top 3 line those are required by Bootstrap.

 This Example is from Bootstrap of the Basic Template:

Code:
<!DOCTYPE html>
<html lang="en">
 <head>
   <meta charset="utf-8">
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta name="viewport" content="width=device-width, initial-scale=1">
   <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
   <title>Bootstrap 101 Template</title>

   <!-- Bootstrap -->
   <link href="css/bootstrap.min.css" rel="stylesheet">

   <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
   <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
   <!--[if lt IE 9]>
     <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
     <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
   <![endif]-->
 </head>
 <body>
   <h1>Hello, world!</h1>

   <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
   <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
   <!-- Include all compiled plugins (below), or include individual files as needed -->
   <script src="js/bootstrap.min.js"></script>
 </body>
</html>
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
Bootstrap.css not working - by fresh96 - 09-02-2018, 09:01 PM
RE: Bootstrap.css not working - by Pertti - 09-03-2018, 12:56 AM
RE: Bootstrap.css not working - by InsiteFX - 09-03-2018, 09:05 AM
RE: Bootstrap.css not working - by Wouter60 - 09-03-2018, 01:03 PM



Theme © iAndrew 2016 - Forum software by © MyBB