User61956409 posted
Hi comicrage,
I tried add css styling but the navbar background color stays white.
You can try to use !important
declaration, like below:
.navbar {
height: 80px;
background-color: grey !important
}
And if you'd like to dynamically bind menu items, you can try to refer to the following code snippet.
<div ng-app="MyApp" class="container" ng-controller="MyCtrl">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">WebSiteName</a>
</div>
<ul class="nav navbar-nav">
<li ng-repeat="menuItem in MenuItems">
<a href="#">{{menuItem.title}}</a>
</li>
</ul>
</div>
</nav>
</div>
CSS style:
<style>
li {
display: inline-block
}
li > a:before {
content: '|'
}
.navbar {
/*height: 80px;*/
background-color: grey !important
}
</style>
JavaScript code:
<script>
var app = angular.module('MyApp', []);
app.controller("MyCtrl", function ($scope, $http) {
$scope.MenuItems = [
{ "icon": "xxxxx", "title": "Home" },
{ "icon": "xxxxx", "title": "Page 1" },
{ "icon": "xxxxx", "title": "Page 2" },
{ "icon": "xxxxx", "title": "Page 3" }
];
})
</script>
With Regards,
Fei Han