1

I have a header.php file that I want to include in a CodeIgniter view. The header is shown but the problem is that the CSS styles that I have written inside the header.php file are not applied and I don't understand why. This is my header:

<html>
<head>
<title><?php echo $title;?></title>
<link rel="stylesheet"
href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

</head>
<body >
<style>

.nav.navbar-nav li a{
color: #3232ff;
}
</style>

<nav class="navbar navbar-default">
  <div class="container-fluid">

    <ul class="nav navbar-nav">
  <li><a href="#"> <span class="glyphicon glyphicon-home"></span> Home </a> 
</li>

  <li><a href="#"> <span class="glyphicon glyphicon-off"></span> Log out</a>
</li>
</ul>
  </div>
</nav>
</body>
</html>

P.S The weird thing is, if I include the css as inline styling , it works

Lucas
  • 15
  • 6
eri
  • 109
  • 3
  • 9
  • Yes I know, but have you actually checked in element inspector? – BenM Aug 26 '17 at 15:19
  • The specificity of the bootstrap css is too strong for you. Use !important – Brian Gottier Aug 26 '17 at 15:42
  • @BrianGottier Thanks, it works now – eri Aug 26 '17 at 15:47
  • **Do not use `!important`**! Write a more specific selector! – BenM Aug 26 '17 at 16:16
  • You forgot `type="text/css"` –  Aug 26 '17 at 21:29