이 작업은 간단 할 수 있지만 필요한 작업을 수행 할 수 없습니다.부트 스트랩 3 활성 메뉴 상태 색상
기본적으로 해당 페이지가 활성화되어있을 때 부트 스트랩의 기본 파란색이 아닌 다른 것으로 색을 변경하고 싶습니다.
나는 많은 다른 CSS를 시도했다, 그러나 이것은 내 전류 :
ul.nav a:active {
background-color: #3366CC !important;
}
사용하여 메신저 네비게이션 바는 다음과 같다 : 간단한 CSS는
<nav class="navbar navbar-default navbar-static-top" role="navigation">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav nav-pills nav-justified fixed-top">
<li class="active"><a href="">Home</a></li>
등
있는가 내가 빠진 규칙은 다음과 같이 다른 메뉴 요구 사항에 따라 색상이 아주 자유롭게 바뀝니다.
ul.nav {
padding: 5px;
}
ul.nav li a {
color: #fff;
}
ul.nav li a:hover{
color: #CC0033 !important;
}
ul.nav a:hover {
background-color: #fff !important;
}
도움이 될 것입니다! 예를 들어, 사용자가 버튼을 클릭하는 과정에있을 때, 활성 의사 클래스에만 일치 :
나는'! important'를 사용하지 않을 것입니다. – hungerstar