요소 상태가 focus
과 관련되어 있는지 확실하지 않지만 .nav-pills
(아래 예 참조) 중 하나를 클릭하면 마우스를 움직여도 .active
이됩니다 내가 페이지의 다른 곳을 클릭 할 때까지 Google 크롬 웹 검사기에서는이 사실을 알 수 없습니다. 첫 번째 약을 내 페이지에서 유일한 활성 약으로하고 싶습니다. BS .nav-pills stay depressed
죄송합니다
/* Primary Syle Sheet */
/* Basic Typography */
#topnav {
\t margin-bottom: 30px;
}
#topnav .nav-pills > li {
\t margin-left: 11px;
\t margin-right: 11px;
\t text-size: 100px;
}
#topnav>.nav-pills>li>a {
\t padding-top: 11px;
\t padding-bottom: 11px;
\t font-size: 24px;
\t color: #333;
}
#topnav>.nav-pills>li.active>a, #topnav>.nav-pills>li>a:hover {
\t background-color: #eee;
}
.nav-pills>li>a:hover {
\t opacity: 0.7;
}
#navbar-nav>li>a {
padding-top: 10px;
padding-bottom: 10px;
line-height: 20px;
}
@media (min-width: 768px) {
\t #navbar-nav>li>a {
\t padding-top: 15px;
\t padding-bottom: 15px;
\t margin-top: 3px;
\t margin-bottom: 3px;
}
#navbar-nav {
\t width: 100%;
\t text-align: center !important;
\t }
\t #navbar-nav > li {
\t float: none;
\t display: inline-block;
}
}
.center-pills {
\t display: inline-block;
}
.h1 small.sbttl, .h2 small.sbttl, .h3 small.sbttl, .h4 small.sbttl, .h5 small.sbttl, .h6 small.sbttl, h1 small.sbttl, h2 small.sbttl, h3 small.sbttl, h4 small.sbttl, h5 small.sbttl, h6 small.sbttl {
\t display: block;
\t font-size: 33%;
\t color: inherit !important;
\t opacity: 0.75;
}
/* Targeted Stylings */
header {
background-color: yellow;
background-repeat: no-repeat;
background-attachment: scroll;
background-position: center center;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
text-align: center;
color: #fff !important;
}
@media (min-width: 768px) {
\t header .brand-name {
\t padding-top: 200px !important;
\t padding-bottom: 200px !important;
\t }
}
header .brand-name {
padding-top: 100px;
padding-bottom: 100px;
}
header .brand-name h1 {
\t font-size: 75px;
\t font-style: italic;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Example</title>
<!-- Primary Stylesheets -->
<link href="css/styles_1.css" rel="stylesheet">
<!-- Bootstrap -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body id="page-top" class="index">
\t <header>
\t \t <div class="container">
\t \t \t <div class="brand-name">
\t \t \t \t <h1>Title <small class="sbttl">Subtitle</small></h1>
\t \t \t </div>
\t \t
\t \t \t <!-- Initial -->
\t \t \t <div class="container text-center" id="topnav">
\t \t \t \t <ul class="nav nav-pills center-pills">
\t \t \t \t \t <li role="presentation" class="active"><a href="#">content</a></li>
\t \t \t \t \t <li role="presentation"><a href="#">content</a></li>
\t \t \t \t \t <li role="presentation"><a href="#">content</a></li>
\t \t \t \t \t <li role="presentation"><a href="#">content</a></li>
\t \t \t \t </ul>
\t \t \t </div>
\t \t </div>
\t </header>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
</body>
</html>
그래서 ... 내가 필요로하는 페이지의 다른 곳을 클릭 할 때까지 그 상태에 머물러 있지 않습니까? – jajaperson
CSS의 'li : hover'에서 모든 것을 지우고 싶거나'li : hover {color : black; } '또는 무엇이든 디자인에 가장 적합합니다. – mark
하지만 실제로 마우스를 가리키면 마우스를 가리킬 수 없습니다. 또한 알약의 색이 먹는 피임약의 색상과 ': 호버'와 일치하지 않기 때문에이 해결책이 맞는지 확실하지 않습니다 – jajaperson