"Navbar with split buttons second attempt"
Bootstrap 4.0.0 Snippet by ChickenDumpLing

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<header>
<div id="navbar" class="container-fluid">
<div class="container nav-fill w-100">
<nav class="navbar navbar-expand-md navbar-light" role="navigation">
<button class="navbar-toggler" data-toggle="collapse" data-target="#navbarContent" aria-controls="navbarContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarContent">
<ul class="navbar-nav nav-fill w-100">
<li class="nav-item">
<a href="/home.html" role="button" class="btn btn-default">Home</a>
</li>
<li class="nav-item">
<div class="btn-group">
<a href="/brand.html" role="button" class="btn btn-default">Brand</a>
<button class="btn btn-default dropdown-toggle dropdown-toggle-split d-none d-md-block" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">Toggle Dropdown</span>
</button>
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Item</a>
</div>
</div>
</li>
<li class="nav-item">
<div class="btn-group">
<a href="/accessories.html" role="button" class="btn btn-default">Make</a>
<button class="btn btn-default dropdown-toggle dropdown-toggle-split d-none d-md-block" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">Toggle Dropdown</span>
</button>
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Item</a>
</div>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#navbar {
background-color:#f90;
}
#navbar .btn {
border:0px solid transparent;
}
#navbar .btn-default.focus, #navbar .btn-default:focus {
-webkit-box-shadow: none !important;
box-shadow: none !important;
}
#navbar li.nav-item a {
font-weight:700;
color:#333;
}
#navbar li.nav-item a:hover {
color:#fff;
}
#navbar a.dropdown-item {
font-weight:400 !important;
}
#navbar button.dropdown-toggle-split {
background-color:transparent;
}
#navbar button.dropdown-toggle-split:hover {
color:#fff;
}
#navbar button.dropdown-toggle-split:active {
outline:none;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
/*
Navbar using default Bootstrap 4
Goal:
Navbar items go to landing pages
Navbar split buttons open dropdowns to specific pages
Evenly spaced across container
Carets disappear on phones
Haven't worked on dropdown styling yet
*/
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: