Active link border/underline over a bootstrap navbar class - css

I have been trying to adapt the solution from the question Active link border/underline asked by me.
I tried to adopt the same solution in the bootstrap navbar but there are some other effects with that solution.
Like I changed the padding of nav.navbar to 15px 20px 0px, the actual problem was solved whereas the hover and the alignment of the icon moved slightly down from the center.
nav.navbar {
align-items: center;
padding: 15px 20px 0px;
position: sticky;
background-color: white;
z-index: 100;
top: 0;
box-shadow: 0px 5px 8px -9px rgba(0, 0, 0, 75);
}
* {
margin: 0;
padding: 0;
}
nav.navbar {
padding: 15px 20px 0px;
position: sticky;
background-color: white;
z-index: 100;
top: 0;
box-shadow: 0px 5px 8px -9px rgba(0, 0, 0, 75);
}
.header__left>img {
height: 40px;
}
.header__items {
display: flex;
align-items: center;
justify-content: center;
margin-right: 8px;
cursor: pointer;
width: 40px;
height: 40px;
background-color: #e4e6eb;
border-radius: 50%;
transition: background-color 0.2s ease-in-out;
transition-timing-function: cubic-bezier(0, 0, 1, 1);
}
.header__center {
display: flex;
flex-direction: row;
justify-content: center;
}
.header__option {
display: flex;
align-items: center;
padding: 0 2vw;
cursor: pointer;
height: 52px;
}
.header__right {
display: flex;
}
.header__info {
display: flex;
align-items: center;
padding-right: 12px;
}
.header__info>span {
margin-left: 10px;
}
.header__option:hover {
background-color: #f0f2f5;
border-top-left-radius: 1px;
border-top-right-radius: 1px;
border-bottom-right-radius: 1px;
border-bottom-left-radius: 1px;
}
.header__option.active,
.header__option.active:hover {
color: #1877f2;
border-bottom: 1px solid #1877f2;
border-bottom-width: 3px;
background-color: #f8f9fa;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" integrity="sha512-1PKOgIY59xJ8Co8+NE6FZ+LOAZKjy+KY8iq0G4B3CyeY6wYHN3yt9PW0XpSriVlkMXe40PTKnXrLnZ9+fkDaog==" crossorigin="anonymous" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous" />
<nav class="navbar navbar-light bg-light">
<div class="header__left">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Free_logo.svg/600px-Free_logo.svg.png" />
</div>
<div class="header__center">
<div class="header__option active">
<i class="fas fa-home"></i>
</div>
<div class="header__option">
<i class="fas fa-users"></i>
</div>
<div class="header__option">
<i class="fas fa-video"></i>
</div>
</div>
<div class="header__right">
<div class="header__info">
<i class="fas fa-user-circle fa-lg"></i>
<span class="header__info__name">Aakash</span>
</div>
<div class="header__items">
<i class="fas fa-bell"></i>
</div>
<div class="header__items">
<i class="fas fa-bell"></i>
</div>
<div class="header__items">
<i class="fas fa-bell"></i>
</div>
</div>
</nav>
The effect I wanted to have while hovering the icon.
Updated questions to reflect what I also want:

You can add a "fake" bottom border same color as the background of navbar to the icons.
Like so -
* {
margin: 0;
padding: 0;
}
nav.navbar {
align-items: center;
padding: 0px 20px 0px; /* REMOVED TOP PADDING */
position: sticky;
background-color: white;
z-index: 100;
top: 0;
box-shadow: 0px 5px 8px -9px rgba(0, 0, 0, 75);
}
.header__left>img {
height: 40px;
}
.header__center {
display: flex;
flex-direction: row;
justify-content: center;
}
.header__option {
display: flex;
align-items: center;
padding: 0 2vw;
cursor: pointer;
height: 52px;
/* REMOVED BORDER */
/*border-bottom: 1px solid #f8f9fa;*/ /* the fake border */
/*border-bottom-width: 3px;*/ /* fake border width */
/* ADDED BOX SHADOW */
box-shadow: inset 0 -3px #f8f9fa;
}
.header__right {
display: flex;
}
.header__info {
display: flex;
align-items: center;
padding-right: 12px;
}
.header__info>span {
margin-left: 10px;
}
.header__option:hover {
background-color: #f0f2f5;
border-top-left-radius: 1px;
border-top-right-radius: 1px;
border-bottom-right-radius: 1px;
border-bottom-left-radius: 1px;
}
.header__option.active,
.header__option.active:hover {
color: #1877f2;
border-bottom: 1px solid #1877f2;
border-bottom-width: 3px;
background-color: #f8f9fa;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" integrity="sha512-1PKOgIY59xJ8Co8+NE6FZ+LOAZKjy+KY8iq0G4B3CyeY6wYHN3yt9PW0XpSriVlkMXe40PTKnXrLnZ9+fkDaog==" crossorigin="anonymous" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous" />
<nav class="navbar navbar-light bg-light">
<div class="header__left">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Free_logo.svg/600px-Free_logo.svg.png" />
</div>
<div class="header__center">
<div class="header__option active">
<i class="fas fa-home"></i>
</div>
<div class="header__option">
<i class="fas fa-users"></i>
</div>
<div class="header__option">
<i class="fas fa-video"></i>
</div>
</div>
<div class="header__right">
<div class="header__info">
<i class="fas fa-user-circle fa-lg"></i>
<span class="header__info__name">Aakash</span>
</div>
</div>
</nav>
Update: Changed border-bottom in header_options property to box-shadow.
2nd Update: removed top padding from nav.navbar to vertically center icons.

You could use inner box-shadow.
.header__option.active,
.header__option:hover {
color: #1877f2;
box-shadow: inset 0 -3px #1877f2;
/* border-bottom: 1px solid #1877f2; */
border-bottom-width: 3px;
background-color: #f8f9fa;
}
nav.navbar {
align-items: center;
padding: 15px 20px 0px;
position: sticky;
background-color: white;
z-index: 100;
top: 0;
box-shadow: 0px 5px 8px -9px rgba(0, 0, 0, 75);
}
* {
margin: 0;
padding: 0;
}
nav.navbar {
align-items: center;
padding: 15px 20px 0px;
position: sticky;
background-color: white;
z-index: 100;
top: 0;
box-shadow: 0px 5px 8px -9px rgba(0, 0, 0, 75);
}
.header__left>img {
height: 40px;
}
.header__items {
display: flex;
align-items: center;
justify-content: center;
margin-right: 8px;
cursor: pointer;
width: 40px;
height: 40px;
background-color: #e4e6eb;
border-radius: 50%;
transition: background-color 0.2s ease-in-out;
transition-timing-function: cubic-bezier(0, 0, 1, 1);
}
.header__center {
display: flex;
flex-direction: row;
justify-content: center;
}
.header__option {
display: flex;
align-items: center;
padding: 0 2vw;
cursor: pointer;
height: 52px;
}
.header__right {
display: flex;
}
.header__info {
display: flex;
align-items: center;
padding-right: 12px;
}
.header__info>span {
margin-left: 10px;
}
.header__option:hover {
background-color: #f0f2f5;
border-top-left-radius: 1px;
border-top-right-radius: 1px;
border-bottom-right-radius: 1px;
border-bottom-left-radius: 1px;
}
.header__option.active,
.header__option:hover {
color: #1877f2;
box-shadow: inset 0 -3px #1877f2;
/* border-bottom: 1px solid #1877f2; */
border-bottom-width: 3px;
background-color: #f8f9fa;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" integrity="sha512-1PKOgIY59xJ8Co8+NE6FZ+LOAZKjy+KY8iq0G4B3CyeY6wYHN3yt9PW0XpSriVlkMXe40PTKnXrLnZ9+fkDaog==" crossorigin="anonymous" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous" />
<nav class="navbar navbar-light bg-light">
<div class="header__left">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Free_logo.svg/600px-Free_logo.svg.png" />
</div>
<div class="header__center">
<div class="header__option active">
<i class="fas fa-home"></i>
</div>
<div class="header__option">
<i class="fas fa-users"></i>
</div>
<div class="header__option">
<i class="fas fa-video"></i>
</div>
</div>
<div class="header__right">
<div class="header__info">
<i class="fas fa-user-circle fa-lg"></i>
<span class="header__info__name">Aakash</span>
</div>
<div class="header__items">
<i class="fas fa-bell"></i>
</div>
</div>
</nav>

Related

Center Align with CSS Grid

I've got a button class="view-more" that I'm trying to center align on the page within my div class="main" but I just cannot get it to move.
I've tried the align-self, content, and items along with justify options but it just stays at the bottom left of the div.
I think my positions might be causing the issue but I'm not sure. I'm still learning and those are throwing me off.
Here is the full main code.
main {
background-color: var(--secondary-color);
height: 1060px;
}
main .videos {
display: grid;
grid-template-columns: 50% 50%;
margin: 5px;
}
main .videos img {
height: 240px;
width: 92%;
margin: 10px 0 0 24px;
box-shadow: 0 4px 8px rgba(0, 0, 0, .4);
z-index: 100;
position: relative;
}
main a {
position: relative;
}
main .videos h4 {
padding: 0;
margin: 15px 0 0 0;
color: var(--light-color);
text-align: center;
font-family: 'Oswald', sans-serif;
font-size: 1.6em;
}
main .videos h4 span {
background-color: rgba(0, 0, 0, 0.1);
padding: 0 10px;
border-radius: 10px;
}
main .videos i {
position: absolute;
color: white;
z-index: 3;
top: 30%;
left: 40%;
box-shadow: 0 4px 8px rgba(0, 0, 0, .8);
border-radius: 100px;
}
main .view-more {
position: absolute;
border-radius: 10px;
background-color: var(--dark-color);
color: var(--hightlight-color);
}
<main>
<h3>Featured Videos</h3>
<div class="videos">
<h4><span>Hands // Tobias Levin</span></h4>
<h4><span>Rise // Virtuoso</span></h4>
<i class="fas fa-play-circle fa-7x"></i><img src="/images/tobias1.jpg" alt="">
<i class="fas fa-play-circle fa-7x"></i><img src="/images/rise.jpg" alt="">
<h4><span>This is Dan and Dave</span></h4>
<h4><span>Super // Chris Webber</span></h4>
<i class="fas fa-play-circle fa-7x"></i><img src="/images/dand.jpg" alt="">
<i class="fas fa-play-circle fa-7x"></i><img src="/images/cwebber.jpg" alt="">
<h4><span>Superhuman // Brian Tudor</span></h4>
<h4><span>Smoke Screen // Jaspas Deck</span></h4>
<i class="fas fa-play-circle fa-7x"></i><img src="/images/bt.jpg" alt="">
<i class="fas fa-play-circle fa-7x"></i><img src="/images/smokescreen.jpg" alt="">
</div>
<button class="view-more">Open The Vault</button>
</main>
Do you mind if the title/everything in the main container is centered? If not, you can simply add text-align center to the container which would center the children. The problem with your code not moving the button is because you added "position absolute" to the button, meaning it will not center relative to its parent, but rather to the window. I removed that position absolute, and the button will now listen to its parent. Does that make sense?
main {
background-color: var(--secondary-color);
height: 1060px;
text-align: center;
}
main .videos {
display: grid;
grid-template-columns: 50% 50%;
margin: 5px;
}
main .videos img {
height: 240px;
width: 92%;
margin: 10px 0 0 24px;
box-shadow: 0 4px 8px rgba(0, 0, 0, .4);
z-index: 100;
position: relative;
}
main a {
position: relative;
}
main .videos h4 {
padding: 0;
margin: 15px 0 0 0;
color: var(--light-color);
text-align: center;
font-family: 'Oswald', sans-serif;
font-size: 1.6em;
}
main .videos h4 span {
background-color: rgba(0, 0, 0, 0.1);
padding: 0 10px;
border-radius: 10px;
}
main .videos i {
position: absolute;
color: white;
z-index: 3;
top: 30%;
left: 40%;
box-shadow: 0 4px 8px rgba(0, 0, 0, .8);
border-radius: 100px;
}
main .view-more {
border-radius: 10px;
background-color: var(--dark-color);
color: var(--hightlight-color);
}
<main>
<h3>Featured Videos</h3>
<div class="videos">
<h4><span>Hands // Tobias Levin</span></h4>
<h4><span>Rise // Virtuoso</span></h4>
<i class="fas fa-play-circle fa-7x"></i><img src="/images/tobias1.jpg" alt="">
<i class="fas fa-play-circle fa-7x"></i><img src="/images/rise.jpg" alt="">
<h4><span>This is Dan and Dave</span></h4>
<h4><span>Super // Chris Webber</span></h4>
<i class="fas fa-play-circle fa-7x"></i><img src="/images/dand.jpg" alt="">
<i class="fas fa-play-circle fa-7x"></i><img src="/images/cwebber.jpg" alt="">
<h4><span>Superhuman // Brian Tudor</span></h4>
<h4><span>Smoke Screen // Jaspas Deck</span></h4>
<i class="fas fa-play-circle fa-7x"></i><img src="/images/bt.jpg" alt="">
<i class="fas fa-play-circle fa-7x"></i><img src="/images/smokescreen.jpg" alt="">
</div>
<button class="view-more">Open The Vault</button>
</main>

Active link border/underline

I would like to put an underline on the active icon link. I am able to underline but it is too close to the icon but I want to underline at the bottom-top of the navigation bar as shown in the image below.
* {
margin: 0;
padding: 0;
}
.header {
display: flex;
justify-content: space-between;
padding: 15px 20px;
position: sticky;
background-color: white;
z-index: 100;
top: 0;
box-shadow: 0px 5px 8px -9px rgba(0, 0, 0, 75);
}
.header__left>img {
height: 40px;
}
.header__center {
display: flex;
flex-direction: row;
justify-content: center;
}
.header__option {
display: flex;
align-items: center;
padding: 0 2vw;
cursor: pointer;
height: 52px;
}
.header__right {
display: flex;
}
.header__info {
display: flex;
align-items: center;
padding-right: 12px;
}
.header__info>span {
margin-left: 10px;
}
.header__option.active>i {
color: #1877f2;
border-bottom: 1px solid red;
border-bottom-width: 3px;
bottom: 0;
}
.header__option:hover {
background-color: #f0f2f5;
border-top-left-radius: 1px;
border-top-right-radius: 1px;
border-bottom-right-radius: 1px;
border-bottom-left-radius: 1px;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" rel="stylesheet" />
<div class="header">
<div class="header__left">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Free_logo.svg/600px-Free_logo.svg.png" />
</div>
<div class="header__center">
<div class="header__option active">
<i class="fas fa-home"></i>
</div>
<div class="header__option">
<i class="fas fa-users"></i>
</div>
<div class="header__option">
<i class="fas fa-video"></i>
</div>
</div>
<div class="header__right">
<div class="header__info">
<i class="fas fa-user-circle fa-lg"></i>
<span class="header__info__name">Aakash</span>
</div>
</div>
</div>
What is the way of underlining the icon with the exact width that is taken while hovering over the icons?
You need to apply the border on the parent element of the icon
* {
margin: 0;
padding: 0;
}
.header {
display: flex;
justify-content: space-between;
padding: 15px 20px 0px 20px; /* was padding: 15px 20px */
position: sticky;
background-color: white;
z-index: 100;
top: 0;
box-shadow: 0px 5px 8px -9px rgba(0, 0, 0, 75);
}
/* added below four lines for image centering */
.header__left {
display: flex;
align-items: center;
}
.header__left>img {
height: 40px;
}
.header__center {
display: flex;
flex-direction: row;
justify-content: center;
}
.header__option {
display: flex;
align-items: center;
padding: 0 2vw;
cursor: pointer;
height: 52px;
}
.header__right {
display: flex;
}
.header__info {
display: flex;
align-items: center;
padding-right: 12px;
}
.header__info>span {
margin-left: 10px;
}
/* added below four lines for bottom border on active link */
.header__option.active {
border-bottom: 1px solid red;
border-bottom-width: 3px;
}
.header__option.active>i {
color: #1877f2;
/* removed border-bottom, border-bottom-width and bottom rules */
}
.header__option:hover {
background-color: #f0f2f5;
border-top-left-radius: 1px;
border-top-right-radius: 1px;
border-bottom-right-radius: 1px;
border-bottom-left-radius: 1px;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" integrity="sha512-1PKOgIY59xJ8Co8+NE6FZ+LOAZKjy+KY8iq0G4B3CyeY6wYHN3yt9PW0XpSriVlkMXe40PTKnXrLnZ9+fkDaog==" crossorigin="anonymous" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" rel="stylesheet" />
<div class="header">
<div class="header__left">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Free_logo.svg/600px-Free_logo.svg.png" />
</div>
<div class="header__center d-none d-xl-flex d-md-flex">
<div class="header__option active">
<i class="fas fa-home"></i>
</div>
<div class="header__option">
<i class="fas fa-users"></i>
</div>
<div class="header__option">
<i class="fas fa-video"></i>
</div>
</div>
<div class="header__right">
<div class="header__info d-none d-xl-flex">
<i class="fas fa-user-circle fa-lg"></i>
<span class="header__info__name">Aakash</span>
</div>
</div>
</div>
It's better to use pseudo elements (::after & ::before) for active states and for the underline.
.header__option{
position: relative;
}
.header__option.active::after{
content:'';
position: absolute;
bottom: -10px; (set it accordingly)
left: 0;
width: 100%;
height: 1px;
background: red;
}
* {
margin: 0;
padding: 0;
}
.header {
display: flex;
justify-content: space-between;
padding: 15px 20px 0;
position: sticky;
background-color: white;
z-index: 100;
top: 0;
box-shadow: 0px 5px 8px -9px rgba(0, 0, 0, 75);
}
.header__left>img {
height: 40px;
}
.header__center {
display: flex;
flex-direction: row;
justify-content: center;
}
.header__option {
display: flex;
align-items: center;
padding: 0 2vw;
cursor: pointer;
height: 52px;
}
.header__right {
display: flex;
}
.header__info {
display: flex;
align-items: center;
padding-right: 12px;
}
.header__info>span {
margin-left: 10px;
}
.header__option.active {
color: #1877f2;
border-bottom: 1px solid red;
border-bottom-width: 3px;
}
.header__option:hover {
background-color: #f0f2f5;
border-top-left-radius: 1px;
border-top-right-radius: 1px;
border-bottom-right-radius: 1px;
border-bottom-left-radius: 1px;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" integrity="sha512-1PKOgIY59xJ8Co8+NE6FZ+LOAZKjy+KY8iq0G4B3CyeY6wYHN3yt9PW0XpSriVlkMXe40PTKnXrLnZ9+fkDaog==" crossorigin="anonymous" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" rel="stylesheet" />
<div class="header">
<div class="header__left">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Free_logo.svg/600px-Free_logo.svg.png" />
</div>
<div class="header__center d-none d-xl-flex d-md-flex">
<div class="header__option active">
<i class="fas fa-home"></i>
</div>
<div class="header__option">
<i class="fas fa-users"></i>
</div>
<div class="header__option">
<i class="fas fa-video"></i>
</div>
</div>
<div class="header__right">
<div class="header__info d-none d-xl-flex">
<i class="fas fa-user-circle fa-lg"></i>
<span class="header__info__name">Aakash</span>
</div>
</div>
</div>
Here is the working example:
* {
margin: 0;
padding: 0;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
position: sticky;
background-color: white;
z-index: 100;
top: 0;
box-shadow: 0px 5px 8px -9px rgba(0, 0, 0, 75);
padding-left: 15px;
padding-right: 15px;
}
.header__left>img {
height: 40px;
}
.header__left .header__option, .header__right .header__option, .header__center .header__option {
height: 60px;
min-width: 60px;
}
.header__center {
display: flex;
flex-direction: row;
justify-content: center;
}
.header__option {
display: flex;
align-items: center;
padding: 0 2vw;
cursor: pointer;
justify-content: center;
}
.header__right {
display: flex;
}
.header__info {
display: flex;
align-items: center;
padding-right: 12px;
}
.header__info>span {
margin-left: 10px;
}
.header__option.active, .header__option.active:hover {
color: #1877f2;
border-bottom: 1px solid red;
border-bottom-width: 3px;
}
.header__option:hover {
background-color: #f0f2f5;
border-bottom: 1px solid #dedede;
border-bottom-width: 3px;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" integrity="sha512-1PKOgIY59xJ8Co8+NE6FZ+LOAZKjy+KY8iq0G4B3CyeY6wYHN3yt9PW0XpSriVlkMXe40PTKnXrLnZ9+fkDaog==" crossorigin="anonymous" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" rel="stylesheet" />
<div class="header">
<div class="header__left">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Free_logo.svg/600px-Free_logo.svg.png" />
</div>
<div class="header__center">
<div class="header__option active">
<i class="fas fa-home"></i>
</div>
<div class="header__option">
<i class="fas fa-users"></i>
</div>
<div class="header__option">
<i class="fas fa-video"></i>
</div>
</div>
<div class="header__right">
<div class="header__info d-none d-xl-flex">
<i class="fas fa-user-circle fa-lg"></i>
<span class="header__info__name">Aakash</span>
</div>
</div>
</div>

Wants to fix CSS and bootstrap issue in my .cshtml in .net project

I want a space between 1st and 2nd record.
I was playing around CSS but no luck so far. Please review my code below and suggest me the way to do.
I am looking for output like below image
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<div class="container col-md-12">
<table style="background-color: rosybrown; border:dashed;">
#foreach (var item in Model)
{
<div class="card">
<div class="card-avatar col-md-2">
<img src="~/Content/images/logo3.png" style="width:100%" />
</div>
<div class="card-details">
<div class="name">#Html.DisplayFor(modelItem => item.DoctorName)</div>
<div class="degree">BDS, MDS - Oral Medicine and Radiology</div>
<div class="exp">14 years experience overall</div>
<div class="occupation">#Html.DisplayFor(modelItem => item.Specialization)</div>
<div class="like">96%</div>
<div class="feedback">120</div>
<div class="location">Hamilton, New Zealand</div>
<div class="fee">100$</div>
<div class="works">32 Smiles Multispeciality Dental Clinic and 15 more clinics</div>
<div class="available">Today</div>
<div class="card-avatar col-md-2">
<img src="~/Content/images/logo3.png" style="width:100%" />
<img src="~/Content/images/logo3.png" style="width:100%" />
<img src="~/Content/images/logo3.png" style="width:100%" />
<img src="~/Content/images/logo3.png" style="width:100%" />
</div>
<div class="card-about">
<div class="item">
<span class="value">Artificial Teeth</span>
<span class="label">Conservative</span>
</div>
<div class="item">
<span class="viewservice">40 services </span>
<span class="label">Weight</span>
</div>
<div class="item">
<span class="btn active">View Profile</span>
<span class="btn active">Contact Clinic</span>
<span class="btn active">Booking Appointment</span>
</div>
</div>
</div>
</div>
}
</table></div>
<style>
.card {
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
transition: 0.3s;
width: 40%;
border-radius: 5px;
}
.card:hover {
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
}
img {
border-radius: 5px 5px 0 0;
}
.container {
padding: 2px 16px;
}
{
box-sizing: border-box;
}
:root {
--background: white;
--primary: #ff1ead;
--secondary: #1effc3;
--card-size: 300px;
}
.card {
width: calc(var(--card-size) * 1.586);
height: var(--card-size);
border-radius: 0.75rem;
box-shadow: 0 22px 70px 4px rgba(0,0,0,0.56), 0 0 0 1px rgba(0, 0, 0, 0.3);
background: darkslateblue;
display: grid;
grid-template-columns: 40% auto;
color: white;
align-items: center;
will-change: transform;
transition: transform 0.25s cubic-bezier(0.4, 0.0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}
{
transform: scale(1.1);
box-shadow: 0 32px 80px 14px rgba(0,0,0,0.36), 0 0 0 1px rgba(0, 0, 0, 0.3);
}
.card-details {
padding: 1rem;
}
.name {
font-size: 1.25rem;
}
.occupation {
font-weight: 600;
color: var(--primary);
}
.card-avatar {
display: grid;
place-items: center;
}
svg {
fill: white;
width: 65%;
}
.card-about {
margin-top: 1rem;
display: grid;
grid-auto-flow: column;
}
.item {
display: flex;
flex-direction: column;
margin-bottom: 0.5rem;
.value
{
font-size: 1rem;
}
.label {
margin-top: 0.15rem;
font-size: 0.75rem;
font-weight: 600;
color: var(--primary);
}
}
.skills {
display: flex;
flex-direction: column;
margin-top: 0.75rem;
.label
{
font-size: 1rem;
font-weight: 600;
color: var(--primary);
}
.value {
margin-top: 0.15rem;
font-size: 0.75rem;
line-height: 1.25rem;
}
}
</style>
A few tips to use.
Text always should be written inside <p> or at least in <span>
Spaces between cards can be created with margin
White spaces in general are made using padding and margin
Don't duplicate selectors in css
Wrap each section of your content in <div> for grouping
Structure your html to keep proper elements flow
Use this Guide to learn how to use grid
It took me too long to create the following snippet, adjust styles based on your liking.
:root {
--background: white;
--primary: #ff1ead;
--secondary: #1effc3;
--card-size: 350px;
}
.card {
margin: 10px;
width: calc(var(--card-size) * 1.586);
height: var(--card-size);
border-radius: 0.75rem;
box-shadow: 0 22px 70px 4px rgba(0, 0, 0, 0.56), 0 0 0 1px rgba(0, 0, 0, 0.3);
background: darkslateblue;
display: grid;
grid-template-columns: 10% auto 20%;
grid-template-rows: auto 20%;
color: white;
align-items: center;
will-change: transform;
transition: transform 0.25s cubic-bezier(0.4, 0.0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}
.card:hover {
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
}
img {
border-radius: 5px 5px 0 0;
}
.container {
padding: 2px 16px;
}
.card-details {
padding: 1rem;
}
p {
margin: 0;
}
.white_space {
margin-top: 20px;
}
.name {
margin: 1rem 0;
font-size: 1.25rem;
}
.occupation {
font-weight: 600;
color: var(--primary);
}
.card-about {
margin-top: 1rem;
display: grid;
}
.item {
background-color: #bbb;
margin: 0 0.1rem;
padding: 7px;
border-radius: 3px;
}
.item.value {
font-size: 0.7rem;
}
.item.label {
margin-top: 0.15rem;
font-size: 0.7rem;
font-weight: 600;
color: var(--primary);
}
.card-btns {
grid-column-start: 2;
grid-column-end: end;
grid-row-start: 2;
grid-row-end: end;
justify-self: end;
margin-right: 20px;
}
.card-btns .btn {
padding: 5px;
border-radius: 5px;
border: 1px solid white;
background-color: var(--primary);
}
<div class="container">
<div class="card">
<div class="card-avatar">
<img src="~/Content/images/logo3.png" style="width:100%" />
</div>
<div class="card-details">
<div class="details">
<h4 class="name">DoctorName</h4>
<p class="degree">BDS, MDS - Oral Medicine and Radiology</p>
<p class="exp">14 years experience overall</p>
<p class="occupation">Specialization</p>
<p class="works white_space">
32 Smiles Multispeciality Dental Clinic and 15 more clinics
</p>
</div>
<div class="card-avatar">
<img src="~/Content/images/logo3.png" style="width:100%" />
<img src="~/Content/images/logo3.png" style="width:100%" />
<img src="~/Content/images/logo3.png" style="width:100%" />
<img src="~/Content/images/logo3.png" style="width:100%" />
</div>
<div class="card-about">
<div class="tags">
<span class="item value">Artificial Teeth</span>
<span class="item label">Conservative</span>
<span class="item label">Weight</span>
</div>
<div class="viewservice white_space">40 services </div>
</div>
</div>
<div class="card-side">
<p class="like">96%</p>
<p class="feedback">120</p>
<p class="location">Hamilton, New Zealand</p>
<p class="fee">100$</p>
<p class="available">Today</p>
</div>
<div class="card-btns">
<span class="btn active">View Profile</span>
<span class="btn active">Contact Clinic</span>
<span class="btn active">Booking Appointment</span>
</div>
</div>
</div>

CSS button in height full with flexbox

I have a snippet with HTML and CSS code (I use and bootstrap):
.main-section .get-tour {
height: 75px;
background: #fcf7f7;
background: -moz-linear-gradient(top, #fcf7f7 0%, #fcf7f7 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fcf7f7), color-stop(100%, #fcf7f7));
-webkit-background-origin: padding-box;
width: 100%;
box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.15);
border-radius: 4px;
display: flex;
align-items: center;
padding-left: 15px;
margin-bottom: 35px;
}
.main-section .get-tour .form-block {
display: inline-block;
margin-right: 15px;
}
.main-section .get-tour .form-block label {
display: block;
font-size: 14px;
font-weight: 300;
margin-bottom: 10px;
}
.main-section .get-tour .form-block i {
font-size: 20px;
color: #a161e1;
margin-right: 5px;
}
.main-section .get-tour .form-block input {
background-color: rgba(113, 9, 245, 0.08);
border: none;
width: 150px;
height: 35px;
}
.main-section .get-tour .form-block button {
height: 75px;
background: #f2994a;
border-radius: 0px 4px 4px 0px;
color: #fff;
font-size: 21px;
border: none;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.2/css/all.min.css">
<section class="main-section">
<div class="container">
<div class="get-tour">
<form action="">
<div class="form-block">
<label>Where</label>
<i class="fas fa-map-marker-alt"></i>
<input type="text">
</div>
<div class="form-block">
<label>Date</label>
<i class="far fa-calendar-alt"></i>
<input type="text">
</div>
<div class="form-block">
<label>Nights</label>
<i class="fas fa-clock"></i>
<input type="text">
</div>
<div class="form-block">
<label>Who</label>
<i class="fas fa-users"></i>
<input type="text">
</div>
<div class="form-block">
<label>Type transport</label>
<i class="fas fa-car"></i>
<input type="text">
</div>
<div class="form-block">
<button type="submit">Search</button>
</div>
</form>
</div>
</div>
</section>
When I set height: 75px; on my button, the whole form rises up, and button does not become in full height of block get-tour. How I can fix this issue? I work with flexbox, on class get-tour I have property align-items: center and all my elements in this block need be vertically center.
Use grid
Grid is good for this situation, kind of table.
See and tell me if it ok for you :)
In more big screen it look better
.main-section {
margin: 10px 0 0 0;
}
.main-section .get-tour {
/* height: 75px; */
background: #fcf7f7;
background: -moz-linear-gradient(top, #fcf7f7 0%, #fcf7f7 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fcf7f7), color-stop(100%, #fcf7f7));
-webkit-background-origin: padding-box;
width: 100%;
box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.15);
border-radius: 4px;
display: flex;
align-items: center;
padding-left: 15px;
margin-bottom: 35px;
}
.form {
display: flex;
}
.main-section .get-tour .form-block label {
display: block;
font-size: 14px;
font-weight: 300;
grid-area: 1 / 2 / 1 / 2;
margin: 0;
overflow: hidden;
}
.main-section .get-tour .form-block i {
font-size: 20px;
color: #a161e1;
grid-area: 2 / 1 / 2 / 1;
display: flex;
align-items: center;
justify-content: center;
}
.main-section .get-tour .form-block input {
background-color: rgba(113, 9, 245, 0.08);
border: none;
width: 100%;
/* width: 150px; */
height: 35px;
grid-area: 2 / 2 / 2 / 2;
}
.main-section .get-tour .search button {
height: 75px;
background: #f2994a;
border-radius: 0px 4px 4px 0px;
color: #fff;
font-size: 21px;
border: none;
margin: 0 0 0 10px;
}
.form-block {
display: grid;
grid-template-columns: 35px 1fr;
grid-template-rows: 25px 35px;
margin: 2px 4px;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.2/css/all.min.css">
<section class="main-section">
<div class="container">
<div class="get-tour">
<form class="form" action="">
<div class="form-block">
<label>Where</label>
<i class="fas fa-map-marker-alt"></i>
<input type="text">
</div>
<div class="form-block">
<label>Date</label>
<i class="far fa-calendar-alt"></i>
<input type="text">
</div>
<div class="form-block">
<label>Nights</label>
<i class="fas fa-clock"></i>
<input type="text">
</div>
<div class="form-block">
<label>Who</label>
<i class="fas fa-users"></i>
<input type="text">
</div>
<div class="form-block">
<label>Type transport</label>
<i class="fas fa-car"></i>
<input type="text">
</div>
<div class="search">
<button type="submit">Search</button>
</div>
</form>
</div>
</div>
</section>
Add display:flex, justify-content: space-between; and width: inherit; to form
form{
display:flex;
justify-content: space-between;
width: inherit;
}
Remove display:inline-block and margin-right:15px; from .main-section .get-tour
.form-block class.
.main-section .get-tour .form-block {
display: inline-block; /*remove this */
margin-right: 15px; /*remove this */
}
Optional:
If u want u can set the button height as 100%;
.main-section .get-tour .form-block button {
height: 75px; /* If u want u can set the button height as 100%*/
background: #f2994a;
border-radius: 0px 4px 4px 0px;
color: #fff;
font-size: 21px;
border: none;
}
Demo:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.2/css/all.min.css">
<style>
form {
display: flex;
justify-content: space-between;
width: inherit;
}
.main-section .get-tour {
height: 75px;
background: #fcf7f7;
background: -moz-linear-gradient(top, #fcf7f7 0%, #fcf7f7 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fcf7f7), color-stop(100%, #fcf7f7));
-webkit-background-origin: padding-box;
width: 100%;
box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.15);
border-radius: 4px;
display: flex;
align-items: center;
padding-left: 15px;
margin-bottom: 35px;
}
.main-section .get-tour .form-block label {
display: block;
font-size: 14px;
font-weight: 300;
margin-bottom: 10px;
margin-left:25px;
}
.main-section .get-tour .form-block i {
font-size: 20px;
color: #a161e1;
margin-right: 5px;
}
.main-section .get-tour .form-block input {
background-color: rgba(113, 9, 245, 0.08);
border: none;
width: 150px;
height: 35px;
}
.main-section .get-tour .form-block button {
height: 75px;
background: #f2994a;
border-radius: 0px 4px 4px 0px;
color: #fff;
font-size: 21px;
border: none;
}
</style>
</head>
<body>
<section class="main-section">
<div class="container">
<div class="get-tour">
<form action="">
<div class="form-block">
<label>Where</label>
<i class="fas fa-map-marker-alt"></i>
<input type="text">
</div>
<div class="form-block">
<label> Date</label>
<i class="far fa-calendar-alt"></i>
<input type="text">
</div>
<div class="form-block">
<label> Nights</label>
<i class="fas fa-clock"></i>
<input type="text">
</div>
<div class="form-block">
<label> Who</label>
<i class="fas fa-users"></i>
<input type="text">
</div>
<div class="form-block">
<label> Type transport</label>
<i class="fas fa-car"></i>
<input type="text">
</div>
<div class="form-block">
<button type="submit">Search</button>
</div>
</form>
</div>
</div>
</section>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.2/css/all.min.css">
<style>
form {
display: flex;
justify-content: space-between;
width: inherit;
}
.main-section .get-tour {
height: 75px;
background: #fcf7f7;
background: -moz-linear-gradient(top, #fcf7f7 0%, #fcf7f7 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fcf7f7), color-stop(100%, #fcf7f7));
-webkit-background-origin: padding-box;
width: 100%;
box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.15);
border-radius: 4px;
display: flex;
align-items: center;
padding-left: 15px;
margin-bottom: 35px;
}
.main-section .get-tour .form-block label {
display: block;
font-size: 14px;
font-weight: 300;
margin-bottom: 10px;
}
.one {
margin-left: 25px;
}
.two {
margin-left: 27px;
}
.three {
margin-left: 26px;
}
.four {
margin-left: 28px;
}
.five {
margin-left: 26px;
}
.main-section .get-tour .form-block i {
font-size: 20px;
color: #a161e1;
margin-right: 5px;
}
.main-section .get-tour .form-block input {
background-color: rgba(113, 9, 245, 0.08);
border: none;
width: 150px;
height: 35px;
}
.main-section .get-tour .form-block button {
height: 75px;
background: #f2994a;
border-radius: 0px 4px 4px 0px;
color: #fff;
font-size: 21px;
border: none;
}
</style>
</head>
<body>
<section class="main-section">
<div class="container">
<div class="get-tour">
<form action="">
<div class="form-block">
<label class="one">Where</label>
<i class="fas fa-map-marker-alt"></i>
<input type="text">
</div>
<div class="form-block">
<label class="two">Date</label>
<i class="far fa-calendar-alt"></i>
<input type="text">
</div>
<div class="form-block">
<label class="three"> Nights</label>
<i class="fas fa-clock"></i>
<input type="text">
</div>
<div class="form-block">
<label class="four"> Who</label>
<i class="fas fa-users"></i>
<input type="text">
</div>
<div class="form-block">
<label class="five"> Type transport</label>
<i class="fas fa-car"></i>
<input type="text">
</div>
<div class="form-block">
<button type="submit">Search</button>
</div>
</form>
</div>
</div>
</section>
</body>
</html>

Need to show a inner DIV outside PARENT div with `overflow:auto`?

Sharing here the demo UI. In this UI, I would want to show the CALENDAR outside the parent window just by using CSS. The Calendar should overflow over the Submit/cancel button div n outside that too]1
Code snippet:
Here, the class date-picker-wrp should come outside the complete MODAL box.
.modalwindow {
z-index: auto;
position: fixed;
box-shadow: 0 0 20px #333;
background-color: #fff;
border-radius: 0;
overflow: inherit;
transform: translate(-50%,-50%);
left: 50%;
top: 50%;
}
.zc-form > div {
max-height: 80vh;
display: flex;
flex-direction: column;
height: 100%;
width: 550px;
position: relative;
border-radius: 5px;
overflow: hidden;
}
.zc-form-body {
max-height: 500px;
overflow: auto;
padding: 10px 30px 30px;
}
.posrel {
position: relative;
}
.zc-form-input{
border-radius: 4px;
line-height: 33px;
padding: 0 18px 0 15px;
font-size: 14px;
color: #2d3138;
position: relative;
height: 35px;
border: solid 0.5px #dedede;
background-color: #fff;
}
.date-picker-wrp{
position: absolute;
border-radius: 4px;
overflow: hidden;
background-color: #fff;
z-index: 1000;
box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 10px 0px;
width: 100%;
margin-top: 2px;
}
.datepicker{
text-align: left;
padding: 10px 7px;
}
.zc-form-footer{
height: 85px;
background-color: #fff;
display: flex;
align-items: center;
padding: 0 30px;
justify-content: space-between;
flex-shrink: 0;
box-shadow: 0px 0px 5px 0 rgba(0, 0, 0, 0.21);
z-index: 1;
}
<div id="form_dialog" type="popup" class="modalwindow zc-form zcalgncntr zcbg_mask">
<div>
<div id="winhead" class="mheader ">Create Modal</div>
<section class="zc-form-body">
<div inputs="">
<div class="font14 mrgT20 posrel">
<div class="zc-form-input-hdr">
<span>date</span>
<span class="clr9 zc-form-hint">Enter the due date</span>
</div>
<div class="posrel cur">
<input placeholder="Ex : 2018/10/11" class="zc-form-input zc-form-date-prvw textL cur">
<span class="zc-form-icons">
<div loading="" class="form-input-loader dN">
<span></span>
<span></span>
<span></span>
</div>
<span class="msi-calndr zcclr font15"></span>
<span class="msi-close zcclr"></span>
</span>
<div class="date-picker-wrp" style="display: block;">
<div element="calendar" class="date-picker">
<div class="datepicker" style="display: block;">
<div class="datepickerContainer" style="width: 0px; height: 0px;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<footer class="zc-form-footer">
<div class="w100 h100 dflx fjustifySB">
<div class="flexC">
<button class="buttn_pos">Add Task</button>
<button class="buttn_neg btn evbtn mrgR20">Cancel</button> </div>
</div>
</footer>
</div>
</div>
Expected result:
I want the calendar dom to appear like the dropdown in below shortcut, but ONLY BY USING PURE CSS ( no javascript calculation)
Please refer this JS Fiddle link: https://jsfiddle.net/dilip96025/gzh26fej/28/
Here, the Country dropdown should come outside the box with con class.
As far as I could reproduce your problem with your current included code, you need to remove overflow: hidden from .zc-form > div and remove overflow: auto from .zc-form-body. The cause of your problem was that overflow: hidden really hides everything that goes beyond its own height and width.
.modalwindow {
z-index: auto;
position: fixed;
box-shadow: 0 0 20px #333;
background-color: #fff;
border-radius: 0;
overflow: inherit;
transform: translate(-50%, -50%);
left: 50%;
top: 50%;
}
.zc-form > div {
max-height: 80vh;
display: flex;
flex-direction: column;
height: 100%;
width: 550px;
position: relative;
border-radius: 5px;
}
.zc-form-body {
max-height: 500px;
padding: 10px 30px 30px;
}
.posrel {
position: relative;
}
.zc-form-input {
border-radius: 4px;
line-height: 33px;
padding: 0 18px 0 15px;
font-size: 14px;
color: #2d3138;
position: relative;
height: 35px;
border: solid 0.5px #dedede;
background-color: #fff;
}
.date-picker-wrp {
position: absolute;
border-radius: 4px;
overflow: hidden;
background-color: #fff;
z-index: 1000;
box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 10px 0px;
width: 100%;
margin-top: 2px;
}
.datepicker {
text-align: left;
padding: 10px 7px;
}
.zc-form-footer {
height: 85px;
background-color: #fff;
display: flex;
align-items: center;
padding: 0 30px;
justify-content: space-between;
flex-shrink: 0;
box-shadow: 0px 0px 5px 0 rgba(0, 0, 0, 0.21);
z-index: 1;
}
<div id="form_dialog" type="popup" class="modalwindow zc-form zcalgncntr zcbg_mask">
<div>
<div id="winhead" class="mheader ">Create Modal</div>
<section class="zc-form-body">
<div inputs="">
<div class="font14 mrgT20 posrel">
<div class="zc-form-input-hdr">
<span>date</span>
<span class="clr9 zc-form-hint">Enter the due date</span>
</div>
<div class="posrel cur">
<input placeholder="Ex : 2018/10/11" class="zc-form-input zc-form-date-prvw textL cur">
<span class="zc-form-icons">
<div loading="" class="form-input-loader dN">
<span></span>
<span></span>
<span></span>
</div>
<span class="msi-calndr zcclr font15"></span>
<span class="msi-close zcclr"></span>
</span>
<div class="date-picker-wrp" style="display: block;">
test1<br>
test2<br>
test3<br>
test4<br>
test5<br>
test6<br>
<div element="calendar" class="date-picker">
<div class="datepicker" style="display: block;">
<div class="datepickerContainer" style="width: 0px; height: 0px;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<footer class="zc-form-footer">
<div class="w100 h100 dflx fjustifySB">
<div class="flexC">
<button class="buttn_pos">Add Task</button>
<button class="buttn_neg btn evbtn mrgR20">Cancel</button> </div>
</div>
</footer>
</div>
</div>
Edit: second code snippet in answer to comment.
.modalwindow {
z-index: auto;
position: fixed;
box-shadow: 0 0 20px #333;
background-color: #fff;
border-radius: 0;
overflow: inherit;
transform: translate(-50%, -50%);
left: 50%;
top: 50%;
}
.zc-form > div {
max-height: 80vh;
display: flex;
flex-direction: column;
height: 100%;
width: 550px;
position: relative;
border-radius: 5px;
}
.zc-form-body {
max-height: 500px;
overflow: auto;
padding: 10px 30px 30px;
}
.posrel {
position: relative;
}
.zc-form-input {
border-radius: 4px;
line-height: 33px;
padding: 0 18px 0 15px;
font-size: 14px;
color: #2d3138;
position: relative;
height: 35px;
border: solid 0.5px #dedede;
background-color: #fff;
}
.date-picker-wrp {
position: absolute;
border-radius: 4px;
overflow: hidden;
background-color: #fff;
z-index: 1000;
box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 10px 0px;
width: 100%;
margin-top: 2px;
}
.datepicker {
text-align: left;
padding: 10px 7px;
}
.zc-form-footer {
height: 85px;
background-color: #fff;
display: flex;
align-items: center;
padding: 0 30px;
justify-content: space-between;
flex-shrink: 0;
box-shadow: 0px 0px 5px 0 rgba(0, 0, 0, 0.21);
z-index: 1;
}
<div id="form_dialog" type="popup" class="modalwindow zc-form zcalgncntr zcbg_mask">
<div>
<div id="winhead" class="mheader ">Create Modal</div>
<section class="zc-form-body">
<div inputs="">
<div class="font14 mrgT20 posrel">
<div class="zc-form-input-hdr">
<span>date</span>
<span class="clr9 zc-form-hint">Enter the due date</span>
</div>
<div class="posrel cur">
<input placeholder="Ex : 2018/10/11" class="zc-form-input zc-form-date-prvw textL cur">
<span class="zc-form-icons">
<div loading="" class="form-input-loader dN">
<span></span>
<span></span>
<span></span>
</div>
<span class="msi-calndr zcclr font15"></span>
<span class="msi-close zcclr"></span>
</span>
<div class="date-picker-wrp" style="display: block;">
test1<br>
test2<br>
test3<br>
test4<br>
test5<br>
test6<br>
<div element="calendar" class="date-picker">
<div class="datepicker" style="display: block;">
<div class="datepickerContainer" style="width: 0px; height: 0px;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<footer class="zc-form-footer">
<div class="w100 h100 dflx fjustifySB">
<div class="flexC">
<button class="buttn_pos">Add Task</button>
<button class="buttn_neg btn evbtn mrgR20">Cancel</button> </div>
</div>
</footer>
</div>
</div>
In the calendar's css add "z-index:1000"
Eg:
<div class="calendar" style="z-index:1000"></div>

Resources