gpt4 book ai didi

css - 删除带有对 Angular 边的 CSS 边框

转载 作者:行者123 更新时间:2023-12-04 08:57:51 26 4
gpt4 key购买 nike

正如您在附加的屏幕截图中看到的那样,我正在尝试删除边框中的对 Angular 线边缘。我该怎么办?
演示:https://jsfiddle.net/3cxn1pbs/
enter image description here
HTML:

<div class="container">
<div class="row mt-2">
<div class="col-3">
<div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical">
<a class="nav-link active" id="v-pills-home-tab" data-toggle="pill" href="#v-pills-home" role="tab" aria-controls="v-pills-home" aria-selected="true">Home</a>
<a class="nav-link" id="v-pills-profile-tab" data-toggle="pill" href="#v-pills-profile" role="tab" aria-controls="v-pills-profile" aria-selected="false">Profile</a>
<a class="nav-link" id="v-pills-messages-tab" data-toggle="pill" href="#v-pills-messages" role="tab" aria-controls="v-pills-messages" aria-selected="false">About</a>
<a class="nav-link" id="v-pills-settings-tab" data-toggle="pill" href="#v-pills-settings" role="tab" aria-controls="v-pills-settings" aria-selected="false">Settings</a>
</div>
</div>
<div class="col-9">
<div class="tab-content" id="v-pills-tabContent">
<div class="tab-pane fade show active" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab">Yo</div>
<div class="tab-pane fade" id="v-pills-profile" role="tabpanel" aria-labelledby="v-pills-profile-tab">...</div>
<div class="tab-pane fade" id="v-pills-messages" role="tabpanel" aria-labelledby="v-pills-messages-tab">...</div>
<div class="tab-pane fade" id="v-pills-settings" role="tabpanel" aria-labelledby="v-pills-settings-tab">...</div>
</div>
</div>
</div>
</div>
CSS
.nav {
border-radius: 4px;
border: solid 1px #dddddd;
background-color: #ffffff;
height: 100%;
min-height: calc(100vh - 200px);
}
.nav-pills .nav-link {
border-radius: 0;
}
.nav-pills .nav-link.active, .nav-pills .show>.nav-link {
color: #333;
background-color: #e6f8fd;
border-right: 4px solid #00b0e6;
border-radius: 0px;
font-weight: 600;
}
.nav-link {
border-bottom: 1px solid #ddd;
border-radius: 0;
color: #333;
}
.nav.flex-column a:first-child, .nav.flex-column a:first-child:hover {
border-top-right-radius: 3px !important;
border-top-left-radius: 3px !important;
}
.nav-link:hover {
color: #333;
background-color: #e6f8fd;
border-radius: 0px !important;
border-right: 4px solid #00b0e6;
}

最佳答案

问题是因为您同时拥有右边框和下边框,请在以下代码段中查看边框的行为。

.container {
height: 100px;
width: 100px;
background-color: transparent;
border-top: 20px green solid;
border-right: 20px orange solid;
border-bottom: 20px silver solid;
border-left: 20px red solid;
}
<div class="container">

</div>

如果你不想要对 Angular 线,你应该删除边框底部的对 Angular 线,你可以使用边框顶部来分隔标签。
.nav .nav-link {
border-bottom: 0px !important;
}

.nav .nav-link {
border-top: 1px #dddddd solid;
}
要在每个选项卡之间留出空格:
您还可以删除边框顶部和边框底部,使用边距顶部/底部
子项,并将背景颜色添加到父容器。

关于css - 删除带有对 Angular 边的 CSS 边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63717847/

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