As you can see in the screenshot attached, I'm trying to remove the diagonal edges in the border. How can I go about it?
DEMO: https://jsfiddle.net/3cxn1pbs/
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;
}
The issue is because of you have both border-right and border-bottom, see how border behaves in follow snippet.
.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>
If you want no diagonal, you should remove diagonal on border-bottom, you can use the border-top instead to separate the tabs.
.nav .nav-link {
border-bottom: 0px !important;
}
.nav .nav-link {
border-top: 1px #dddddd solid;
}
For leaving spaces between each tabs:
You can also remove both border-top and border-bottom, use margin top/bottom for
the sub items, and adding background-color to the parent container.
Related
I'm working with a table-like menu but I can't do it. Here is my CSS.
I'm using bootstrap 5. I can't adjust the padding and also the color of the menu when it's active or not.
.top-nav{
margin-left:0px;
}
.top-bar a {
display: block;
text-align: center;
padding: 20px;
text-decoration: none;
}
.top-bar{
border-bottom: 100px solid white;
border-left: 0 solid transparent;
border-right: 80px solid transparent;
border-top: 80px;
height: 0;
width: 200px;
clip-path: inset(0% 0% 0% 0% round 15px 0px 0px 0px)
}
Here is my HTML
<div class="row top-nav">
<div class="col-md-3 top-bar">
<a class="fw-bold text-primary" href="#home">Users</a>
</div>
<div class="col-md-3 top-bar">
<a class="fw-bold text-primary" href="#home">Warehouse Admin</a>
</div>
<div class="col-md-3 top-bar">
<a class="fw-bold text-primary" href="#home">Sales Rep</a>
</div>
<div class="col-md-3 top-bar">
<a class="fw-bold text-primary" href="#home">Senior Sales Rep</a>
</div>
</div>
My work
This the expected Output
run the snippet and change variables as you like
.folders {
background: lightgray;
padding: 10px;
}
.tabs:after {
content: "";
clear: both;
display: block;
}
.tab {
height: 40px;
line-height: 40px;
width: 150px;
float: left;
background: gray;
border-top-left-radius: 16px 16px;
border-top-right-radius: 16px 16px;
position: relative;
margin-right: 17.5px;
}
.tab.active {
z-index: 100;
background: #fff;
}
.tab:after {
content: "";
display: block;
position: absolute;
border-left: 35px solid gray;
left: 145px;
border-top: 35px solid transparent;
bottom: 0;
}
.tab.active:after {
border-left: 35px solid #fff;
}
.content {
height: 200px;
background: #fff;
}
<div class="folders">
<div class="tabs">
<div class="tab"></div>
<div class="tab active"></div>
<div class="tab"></div>
<div class="tab"></div>
</div>
<div class="contents">
<div class="content"></div>
</div>
</div>
I have a collapsible sidebar. On click of a link from the sidebar, I want to display the components next to the sidebar but they show below it.
My Component Code:
<app-topbar></app-topbar>
<div class="wrapper">
<app-sidebar></app-sidebar>
</div>
<div class="card" style="width: 18rem;">
<img class="card-img-top" src="assets/bn.jpg" alt="Card image cap">
<div class="card-body">
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
My Component's CSS:
.navbar{
background-color: #1F85DE;
}
.card{
flex: auto;
}
My Sidebar Component's HTML:
<nav id="sidebar" class="navbar-dark bg-#1F85DE" style="background-color: #1F85DE;" [ngClass]="{'hidden': sideNavService.hideSideNav }">
<hr>
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="#">Home Page</a>
<hr>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link2</a>
<hr>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link3</a>
<hr>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Profile</a>
<hr>
</li>
</ul>
</nav>
My Sidebars's CSS:
:host {
background: #343a40;
}
#sidebar {
min-width: 200px;
max-width: 200px;
min-height: 100vh;
color: #fff;
transition: all 0.3s;
font-weight: 300;
font-size: 1rem;
line-height: 1.5;
}
#sidebar.hidden {
margin-left: -200px;
}
a[data-toggle="collapse"] {
position: relative;
}
#media (max-width: 575px) {
#sidebar {
margin-left: -200px;
}
#sidebar.hidden {
margin-left: 0;
}
}
a, a:hover, a:focus {
color: inherit;
}
#sidebar .sidebar-header {
padding: 20px;
}
#sidebar ul li a {
padding: 15px;
display: block;
width: 100%;
&:hover {
background-color: rgba(255, 255, 255, 0.1);
}
}
hr {
border-top: 1px solid #fff;
margin-top: 0;
}
.dropdown-submenu {
position: relative;
}
.dropdown-submenu>.dropdown-menu {
top: 0;
left: 100%;
margin-top: -6px;
margin-left: -1px;
-webkit-border-radius: 0 6px 6px 6px;
-moz-border-radius: 0 6px 6px;
border-radius: 0 6px 6px 6px;
}
.dropdown-submenu:hover>.dropdown-menu {
display: block;
}
.dropdown-submenu>a:after {
display: block;
content: " ";
float: right;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 5px 0 5px 5px;
border-left-color: #ccc;
margin-top: 5px;
margin-right: -10px;
}
.dropdown-submenu:hover>a:after {
border-left-color: #fff;
}
.dropdown-submenu.pull-left {
float: none;
}
.dropdown-submenu.pull-left>.dropdown-menu {
left: -100%;
margin-left: 10px;
-webkit-border-radius: 6px 0 6px 6px;
-moz-border-radius: 6px 0 6px 6px;
border-radius: 6px 0 6px 6px;
}
The code is making my Sidebar appear on the left side but the component that I want to display is not occupying the empty save on the right of the sidebar instead, after the sidebar ends, its occupying the save there.
<ng-sidebar-container>
<ng-sidebar [opened]="opened" position="right" mode="push" autoCollapseWidth=100>
<img src="assets/myimage_compressed.jpg" class="rounded-circle" width=80 height=80/>
<ul class="menu">
<li> <a routerLink="/">Dash Board</a></li>
<li> <a routerLink="/post">Post</a></li>
<li><a routerLink="/contact">Contact</a></li>
</ul>
</ng-sidebar>
<div ng-sidebar-content>
<!-- side page component ,Here i have used main component -->
<app-main></app-main>
</div>
</ng-sidebar-container>
I am trying to create a ribbon around a div using Bootstrap 4.
I can't clean the right border; on mobile, when the page is shrinked, my ribbon overflows to the right, out of parent div: https://jsfiddle.net/auj4q3a2/
Html:
<div class="container-fluid">
<div class="card profile-card">
<div class="container-fluid">
<div class="row user-social-detail">
<div class="col-lg-12 col-sm-12 col-12">
<i class="fa fa-facebook" aria-hidden="true"></i>
<i class="fa fa-twitter" aria-hidden="true"></i>
<i class="fa fa-instagram" aria-hidden="true"></i>
<i class="fa fa-linkedin" aria-hidden="true"></i>
</div>
</div>
</div>
</div>
</div>
CSS:
.profile-card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
max-width: 475px;
margin: auto;
text-align: center;
}
.user-social-detail{
margin: 0 -30px;
padding: 15px 0px;
background-color: #ffd280;
border-radius: 4px;
}
.user-social-detail a i{
color:#fff;
font-size:23px;
padding: 0px 5px;
}
.user-social-detail::before,
.user-social-detail::after {
content: '';
position: absolute;
z-index: -1;
left: -45px;
top: -28px;
display: block;
width: 40px;
height: 0px;
border: 30px solid transparent;
border-right: 20px solid #e5bd73;
border-bottom-color: transparent;
border-left-color: transparent;
}
.user-social-detail::after {
left: auto;
right: -45px;
border-left: 20px solid #e5bd73;
border-right: 30px solid transparent;
}
How can I fit the ribbon into the container on mobile, as on the left side?
Any suggestion or feedback will be welcomed and greatly appreciated.
Got it!
You have to add
overflow-x: hidden !important; to .container-fluid
EDIT:
Actually, only in 1st .container-fluid this is necessary, so you can add the following to your CSS file:
.container-fluid:first-of-type {
overflow-x: hidden !important;
}
I have a navBar menu. when clicked opens a submenu.
<nav class="navbar navbar-expand-md navbar-light bg-light">
<div class="collapse navbar-collapse" id="navegacao">
<ul class="navbar-nav mr-auto">
...
</ul>
<ul class="navbar-nav">
<div class="p-2"><i class="material-icons">face</i></div>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown">José da silva</a>
<div class="dropdown-menu" id="menuUsuario" style="padding: 2rem">
<app-menu-porteiro></app-menu-porteiro>
</div>
</li>
</ul>
</div>
</nav>
css
.dropdown-toggle::after {
display:none;
}
.dropdown-menu {
width: 300px;
}
#menuUsuario.dropdown-menu {
width: 300px;
}
#menuUsuario.dropdown-menu:before {
position: absolute;
top: -7px;
left: 4%;
display: inline-block;
border-right: 7px solid transparent;
border-bottom: 7px solid #ccc;
border-left: 7px solid transparent;
border-bottom-color: rgba(0, 0, 0, 0.2);
content: '';
}
#menuUsuario.dropdown-menu:after {
position: absolute;
top: -6px;
left: 4%;
display: inline-block;
border-right: 6px solid transparent;
border-bottom: 6px solid #ffffff;
border-left: 6px solid transparent;
content: '';
}
As shown in the image below, the menu goes beyond the stipulated area of the layout. I would like it to be aligned to the right margin.
I want it to fit within the limit of the screen. But as I'm new to css I can not solve this problem.
I use an affix navbar, that stays fixed on top when scrolling down. I did a lot of changes yesterday, but now the dropdown menu won't open (or at least show)... I can't figure out where the problem lies.
Can anyone see it?
Sooooo: I testet some things. The problem seems to be, that I have following scripts at the end of the body:
<!------------------------------------------------------------ VENDOR JS -->
<script src="<?= DIR_VENDOR ?>jquery/jquery-1.12.4.min.js"></script>
<script src="<?= DIR_VENDOR ?>bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="<?= DIR_VENDOR ?>slider/bootstrap-slider.js"></script>
<!------------------------------------------------------------ SYSTEM JS -->
<script src="<?= DIR_LIBRARIES ?>js/ajax.js"></script>
<script src="<?= $system['template']['web_path'] ?>script.js"></script>
I needed that for bootstrap slider to work. Can you tell me which ones I need to put back in the header again for the dropdown as well as the slider to work?
/********************************************************************* HEADER */
div.header.container-fluid {
width: 100%;
background-image: url(gfx/2.jpg);
background-size: cover;
height: 85vh;
background-attachment: fixed;
}
/********************************************************************** AFFIX */
.affix + .container-fluid {
padding-top: 70px;
}
.affix-top {
background-color: #db091a;
}
.affix-top a {padding: 10px 15px 0px 15px !important;}
.affix {
top: 0;
width: 100%;
-webkit-transition: all .5s ease-in-out;
transition: all .5s ease-in-out;
background-color: #3b3b3b;
border-top: 3px solid #db091a;
}
.affix a {
padding-top: 7px !important;
-webkit-transition: all .5s ease-in-out;
transition: all .5s ease-in-out;
}
/********************************************************************* NAVBAR */
div.navbar.navbar-custom {
-webkit-box-shadow: 0px 2px 10px 0px rgba(77,74,77,1);
-moz-box-shadow: 0px 2px 10px 0px rgba(77,74,77,1);
box-shadow: 0px 2px 10px 0px rgba(77,74,77,1);
border-radius: 0px;
z-index: 1030;
}
/* HEADER */
a.header.navbar-brand {
font-family: Josefin Sans;
font-size: 45px;
text-transform: uppercase;
color: #FFF;
line-height: 50px;
}
/* TOP */
ul.nav.navbar-nav.top {float: right !important;}
a.top {
font-family: 'Palanquin', sans-serif;
text-transform: uppercase;
font-weight: 500;
color: white;
padding: 0px;
margin: 0px 0px 0px 30px;
border-bottom: 3px solid transparent;
}
/* USER */
a.dropdown-toggle.user {padding: 0px 15px 0px 0px; margin-left: 20px;}
span.glyphicon.glyphicon-user {
color: #3b3b3b;
background-color: white;
padding: 5px;
font-size: 30px;
}
/* DROPDOWN */
ul.dropdown-menu {padding: 0px;}
div.collapse.navbar-collapse {padding: 0px;}
ul.nav.navbar-nav.bottom {float: right !important;}
a.dropdown-toggle.drop {
font-family: 'Palanquin', sans-serif;
text-transform: uppercase;
font-weight: 500;
color: white;
padding: 0px;
margin: 0px 0px 5px 30px;
border-bottom: 3px solid transparent;
}
a.dropdown-toggle.drop:hover {border-bottom: 3px solid #db091a;}
a.dropdown-toggle.drop:active {border-bottom: 3px solid #db091a;}
a.dropdown-toggle.drop:focus {border-bottom: 3px solid #db091a;}
<!-- START: HEADER -->
<div class="header container-fluid hidden-xs">
</div>
<!-- START: NAVBAR -->
<div class="navbar navbar-custom" data-spy="affix" data-offset-top="500" id="anker">
<div class="container-fluid">
<div class="row" id="anchor">
<div class="col-sm-6">
<a class="header navbar-brand" href="#"><?= $language['phrases']['site_title']; ?></a>
<button type="button" class="navbar-toggle " data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse">
<div class="col-sm-6">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<span class="glyphicon glyphicon-user hidden-xs"></span> <span class="hidden-sm hidden-md hidden-lg hidden-xl"> Benutzer <b class="caret"></b> </span>
<ul class="dropdown-menu">
<li>beispiel1</li>
<li>beispiel2</li>
<li>beispiel3</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div class="row2">
<div class="container">
<div class="collapse navbar-collapse">
<div class="col-sm-12">
<ul class="nav navbar-nav bottom">
<li class="dropdown">
xMailer <b class="caret"></b>
<ul class="dropdown-menu">
<li>Advertiser</li>
<li>Kampagnen</li>
<li>Listen</li>
<li>Jobs</li>
<li>Nodes</li>
</ul>
</li>
<li class="dropdown">
Administration <b class="caret"></b>
<ul class="dropdown-menu">
<li>Konfigurationen</li>
<li>Module</li>
<li>Seiten</li>
<li>Navigation</li>
<li>Gruppen</li>
<li>Benutzer</li>
<li>Sprachen</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- END: NAVBAR -->
ok problem solved!
the scripts in the html body were the reason for the missing dropdown menu!