gpt4 book ai didi

html - 如何更改非事件颜色选项卡 Bootstrap

转载 作者:太空宇宙 更新时间:2023-11-04 07:24:40 34 4
gpt4 key购买 nike

我正在尝试更改不活动的选项卡,但如何更改?我的代码如下:

CSS

.nav-pills > li.active > a, .nav-pills > li.active > a:focus, .nav-pills > li > a:hover {
background-color: #F47321 !important;
border-color: #FFFFFF !important;
color: #FFFFFF;
}

最佳答案

您使用的代码用于更改事件选项卡和标签悬停时的颜色。

请在下面找到用于更改事件和非事件选项卡颜色的代码。如有任何疑问,请随时提出。

<!DOCTYPE html>
<html lang="en">

<head>
<title>Bootstrap Tabs</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

<style>
/* Change Color for Active Tabs */
.nav-pills>li.active>a,
.nav-pills>li.active>a:focus,
.nav-pills>li.active>a:hover,
.nav-pills>li>a:hover,
.nav>li>a:hover {
background-color: #F47321;
border-color: #FFFFFF;
color: #FFFFFF;
}

/* Change Color for Inactive Tabs */
.nav-pills>li>a {
background-color: #777;
border-color: #FFFFFF;
color: #FFFFFF;
}
</style>
</head>

<body>

<div class="container">
<h1>Change color for tabs</h1>
<hr>
<ul class="nav nav-pills">
<li class="active"><a data-toggle="pill" href="#home">Home</a></li>
<li><a data-toggle="pill" href="#menu1">Menu 1</a></li>
<li><a data-toggle="pill" href="#menu2">Menu 2</a></li>
<li><a data-toggle="pill" href="#menu3">Menu 3</a></li>
</ul>

<div class="tab-content">
<div id="home" class="tab-pane fade in active">
<h3>HOME</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
<div id="menu1" class="tab-pane fade">
<h3>Menu 1</h3>
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
<div id="menu2" class="tab-pane fade">
<h3>Menu 2</h3>
<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam.</p>
</div>
<div id="menu3" class="tab-pane fade">
<h3>Menu 3</h3>
<p>Eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p>
</div>
</div>
</div>

</body>

</html>

关于html - 如何更改非事件颜色选项卡 Bootstrap ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50013539/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com