gpt4 book ai didi

css - Bootstrap 选项卡 - 自定义样式

转载 作者:行者123 更新时间:2023-12-04 16:34:34 24 4
gpt4 key购买 nike

我正在尝试在类似于下面的屏幕截图的 Bootstrap 选项卡上实现相同类型的“箭头”样式。我怎样才能实现类似的目标?

我在 jsfiddle 中有我的示例代码,我在其中使用了 Bootstrap 选项卡。 enter image description here

https://jsfiddle.net/70Luf7hu/

<div>
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li role="presentation">
<a href="#home" aria-controls="home" role="tab" data-toggle="tab">Home</a> </li>
<li role="presentation" class="active">
<a href="#office" aria-controls="profile" role="tab" data-toggle="tab">Office</a>
</li>
<li role="presentation">
<a href="#confirmation" aria-controls="profile" role="tab" data-toggle="tab">Confirm</a>
</li>
</ul>

<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane" id="home">Home</div>
<div role="tabpanel" class="tab-pane active" id="office">Office</div>
<div role="tabpanel" class="tab-pane" id="confirmation">Confirm</div>

</div>

</div>

最佳答案

.nav-tabs > li > a {margin: 0;}
.breadcrumb input[type="radio"] {
display: none;
}
.breadcrumb input[type="checkbox"] {
display: none;
}
.breadcrumb {
background: #ddd;
display: inline-block;
padding: 1px;
padding-right: 14px;
}
.tab-content {
padding: 15px;
}
.breadcrumb li {
display: inline-block;
background: white;
padding: 0;
position: relative;
min-width:50px;
text-decoration: none;
-webkit-clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%, 15px 50%);
clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%, 15px 50%);
margin-right: -13px;
}
.breadcrumb li#last {
-webkit-clip-path: polygon(0 0, calc(100% - 0px) 0, 100% 50%, calc(100% - 0px) 100%, 0 100%, 15px 50%);
clip-path: polygon(0 0, calc(100% - 0px) 0, 100% 50%, calc(100% - 0px) 100%, 0 100%, 15px 50%);
}
.nav-tabs>li.active>a, .nav-tabs>li.active>a:focus, .nav-tabs>li.active>a:hover { border-bottom: 2px solid #5cfeea;}
.breadcrumb li:first-child {
-webkit-clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%);
clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%);
}

<div class="breadcrumb">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li role="presentation">
<a href="#home" aria-controls="home" role="tab" data-toggle="tab">Home</a>
</li>
<li role="presentation" class="active">
<a href="#office" aria-controls="profile" role="tab" data-toggle="tab">Office</a>
</li>
<li id="last" role="presentation">
<a href="#confirmation" aria-controls="profile" role="tab" data-toggle="tab">Confirm</a>
</li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane" id="home">Home</div>
<div role="tabpanel" class="tab-pane active" id="office">Office</div>
<div role="tabpanel" class="tab-pane" id="confirmation">Confirm</div>
</div>
</div>

引用这个

https://jsfiddle.net/70Luf7hu/10/

关于css - Bootstrap 选项卡 - 自定义样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47935237/

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