I have started a project in .NET Core and have used bower to install bootstrap for me. I'm having issues getting the bootstrap navigation styling to work. If I install bootstrap through bower, does it not come with everything from bootstrap? My button styling appears to be working. If I use the CDN, the styling appears for the navigation menu, so I know I'm using the right classes.
Here is what I have for the navigation menu.
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">WebSiteName</a>
</div>
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Page 1</a></li>
<li><a href="#">Page 2</a></li>
<li><button role="button" class="btn btn-danger">Danger</button></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li>
<li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
</ul>
</div>
</nav>
and here is my project structure.
One of my potential issues may be that I'm using gulp as well. Here is my gulp tasks that handle scripts and styles.
var gulp = require('gulp');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var cssmin = require('gulp-cssmin');
gulp.task('js', function () {
// scripts
gulp.src([
'./wwwroot/lib/jquery/dist/jquery.min.js',
'./wwwroot/lib/tether/dist/js/tether.min.js',
'./wwwroot/lib/bootstrap/dist/js/bootstrap.min.js'])
.pipe(concat('scripts.js'))
.pipe(uglify())
.pipe(gulp.dest('./wwwroot/lib/Site'));
});
gulp.task('css', function () {
// bootstrap
gulp.src([
'./wwwroot/lib/tether/dist/css/tether.min.css',
'./wwwroot/lib/bootstrap/dist/css/bootstrap-flex.min.css',
'./wwwroot/lib/bootstrap/dist/css/bootstrap-grid.min.css',
'./wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.min.css',
'./wwwroot/lib/bootstrap/dist/css/bootstrap.min.css'])
.pipe(concat('styles.css'))
.pipe(cssmin())
.pipe(gulp.dest('./wwwroot/lib/Site'));
});
and referencing in my head of the _Layout.cshtml, I have a reference to it as shown.
<environment names="Development">
@*<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />*@
<link href="~/lib/Site/styles.css" rel="stylesheet" />
</environment>
I want some understanding of either why not everything is included for bootstrap with bower, or what I am doing wrong in my gulpfile.