tatsächlich fehlt die nav-justify class
. Sie können es selbst jetzt basierend auf TB3 Code hinzufügen:
SCSS Code:
// Justified nav links
// -------------------------
@mixin nav-justified {
width: 100%;
.nav-item {
float: none;
}
.nav-link {
text-align: center;
margin-bottom: 5px;
}
> .dropdown .dropdown-menu { //todo: remove child selector
top: auto;
left: auto;
}
@include media-breakpoint-up(sm) {
.nav-item {
display: table-cell;
width: 1%;
}
.nav-link {
margin-bottom: 0;
}
}
}
// Move borders to anchors instead of bottom of list
//
// Mixin for adding on top the shared `.nav-justified` styles for our tabs
@mixin nav-tabs-justified {
border-bottom: 0;
.nav-link {
// Override margin from .nav-tabs
margin-right: 0;
border-radius: $border-radius;
}
.nav-link.active,
.nav-link.active:hover,
.nav-link.active:focus {
border: 1px solid $nav-tabs-justified-link-border-color;
}
@include media-breakpoint-up(sm) {
.nav-link {
border-bottom: 1px solid $nav-tabs-justified-link-border-color;
border-radius: $border-radius $border-radius 0 0;
}
.nav-link.active,
.nav-link.active:hover,
.nav-link.active:focus {
border-bottom-color: $nav-tabs-justified-active-link-border-color;
}
}
}
.nav-justified {
@include nav-justified;
@include nav-tabs-justified;
}
zusammengestellt CSS-Code:
.nav-justified {
width: 100%;
border-bottom: 0; }
.nav-justified .nav-item {
float: none; }
.nav-justified .nav-link {
text-align: center;
margin-bottom: 5px; }
.nav-justified > .dropdown .dropdown-menu {
top: auto;
left: auto; }
@media (min-width: 544px) {
.nav-justified .nav-item {
display: table-cell;
width: 1%; }
.nav-justified .nav-link {
margin-bottom: 0; } }
.nav-justified .nav-link {
margin-right: 0;
border-radius: 0.25rem; }
.nav-justified .nav-link.active,
.nav-justified .nav-link.active:hover,
.nav-justified .nav-link.active:focus {
border: 1px solid #ddd; }
@media (min-width: 544px) {
.nav-justified .nav-link {
border-bottom: 1px solid #ddd;
border-radius: 0.25rem 0.25rem 0 0; }
.nav-justified .nav-link.active,
.nav-justified .nav-link.active:hover,
.nav-justified .nav-link.active:focus {
border-bottom-color: #fff; } }
HTML
<div class="container">
<ul class="nav nav-pills nav-justified">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Another link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
</div>
große Bildschirme
kleinen Bildschirm
UPDATE: Ab BS4 Alpha 6 ist die nav-justified
zurück, zusammen mit einer neuen Klasse nav-fill
http://v4-alpha.getbootstrap.com/components/navs/#fill-and-justify
Ich brauche 2-3 Dinge zu ändern, aber es ist genau das, was ich brauche. Ich werde den Haltepunkt in ** md ** ändern. Ich muss nur den SCSS-Compiler installieren. Danke für Ihre Hilfe ! – SatanicGeek