Why does my button always appear above everything? - html

My problem is very clear. As you can see:
I tried a lot of z-index but does not works.
Codepen example
$('.fa-ellipsis-h').click(function() {
$(this)
.css('z-index', 1)
.children('.dropdown')
.toggleClass('display-block');
});
#simpleList {
margin: 0px;
width: 100%;
height: auto;
overflow: auto;
padding: 0;
}
#simpleList li {
list-style-type: none;
padding: 15px 20px 15px 80px;
position: relative;
cursor: normal;
}
#simpleList li:not(:last-child) {
border-bottom: 1px solid #e0e0e0;
}
#simpleList li i.fa-bars {
display: block;
position: absolute;
left: 30px;
top: 50%;
transform: translateY(-50%);
cursor: move;
font-size: 24px;
color: #888;
}
#simpleList li .fa-ellipsis-h {
display: block;
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 30px;
font-size: 18px;
color: #888;
padding: 4px 13px;
border-radius: 5px;
border: 2px solid rgba(0, 0, 0, 0.1);
box-shadow: inset 0 0 5px 0 rgba(0, 0, 0, 0.1);
cursor: pointer;
z-index: 3;
}
#simpleList li .fa-ellipsis-h .dropdown {
position: absolute;
display: none;
padding: 3px 0;
box-shadow: 0 0 10px 3px rgba(0, 0, 0, 0.15);
bottom: -70px;
right: 0;
min-width: 150px;
background-color: #fff;
z-index: 4;
}
#simpleList li .fa-ellipsis-h .dropdown::before {
content: '';
display: block;
width: 10px;
height: 10px;
transform-origin: center center;
transform: rotate(45deg);
position: absolute;
right: 17px;
top: -5px;
background-color: #fff;
}
#simpleList li .fa-ellipsis-h .dropdown div {
padding: 8px 15px;
color: #5b5b5b;
font-size: 14px;
font-weight: 400;
background-color: #fff;
position: relative;
}
#simpleList li .fa-ellipsis-h .dropdown div:hover {
background: #f0f0f0;
}
#simpleList li .kap {
display: flex;
flex-direction: column;
}
#simpleList li .kap .baslik {
font-weight: 700;
font-size: 18px;
margin: 0 0 10px 0;
}
#simpleList li .kap .tarih_cont {
display: flex;
color: #6f6f6f;
font-size: 14px;
}
#simpleList li .kap .tarih_cont .tire {
padding: 0 3px;
}
.display-block {
display: block !important;
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" />
<div class="bolumler">
<ul id="simpleList" class="list-group">
<li class="list-group-item">
<i class="fas fa-bars"></i>
<div class="kap">
<div class="baslik">Bolum 1</div>
<div class="tarih_cont">
<div class="tamamlandimi">Taslak</div>
<span class="tire">-</span>
<div class="tarih">May 09, 2019</div>
</div>
</div>
<div class="fas fa-ellipsis-h">
<div class="dropdown">
<div>Önizleme</div>
<div>Bölümü Sil</div>
</div>
</div>
</li>
<li class="list-group-item">
<i class="fas fa-bars"></i>
<div class="kap">
<div class="baslik">Bolum 2</div>
<div class="tarih_cont">
<div class="tamamlandimi">Taslak</div>
<span class="tire">-</span>
<div class="tarih">May 09, 2019</div>
</div>
</div>
<div class="fas fa-ellipsis-h">
<div class="dropdown">
<div>Önizleme</div>
<div>Bölümü Sil</div>
</div>
</div>
</li>
<li class="list-group-item">
<i class="fas fa-bars"></i>
<div class="kap">
<div class="baslik">Bolum 3</div>
<div class="tarih_cont">
<div class="tamamlandimi">Taslak</div>
<span class="tire">-</span>
<div class="tarih">May 09, 2019</div>
</div>
</div>
<div class="fas fa-ellipsis-h">
<div class="dropdown">
<div>Önizleme</div>
<div>Bölümü Sil</div>
</div>
</div>
</li>
<li class="list-group-item">
<i class="fas fa-bars"></i>
<div class="kap">
<div class="baslik">Bolum 4</div>
<div class="tarih_cont">
<div class="tamamlandimi">Taslak</div>
<span class="tire">-</span>
<div class="tarih">May 09, 2019</div>
</div>
</div>
<div class="fas fa-ellipsis-h">
<div class="dropdown">
<div>Önizleme</div>
<div>Bölümü Sil</div>
</div>
</div>
</li>
<li class="list-group-item">
<i class="fas fa-bars"></i>
<div class="kap">
<div class="baslik">Bolum 5</div>
<div class="tarih_cont">
<div class="tamamlandimi">Taslak</div>
<span class="tire">-</span>
<div class="tarih">May 09, 2019</div>
</div>
</div>
<div class="fas fa-ellipsis-h">
<div class="dropdown">
<div>Önizleme</div>
<div>Bölümü Sil</div>
</div>
</div>
</li>
</ul>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>

It's a stacking context issue, the parent element of the popup is creating a stacking context because you are setting z-index and transform. You need to remove them to be able to see the popup above the other buttons:
$('.fa-ellipsis-h').click(function() {
$(this)
.children('.dropdown')
.toggleClass('display-block');
});
#simpleList {
margin: 0px;
width: 100%;
height: auto;
overflow: auto;
padding: 0;
}
#simpleList li {
list-style-type: none;
padding: 15px 20px 15px 80px;
position: relative;
cursor: normal;
}
#simpleList li:not(:last-child) {
border-bottom: 1px solid #e0e0e0;
}
#simpleList li i.fa-bars {
display: block;
position: absolute;
left: 30px;
top: 50%;
transform: translateY(-50%);
cursor: move;
font-size: 24px;
color: #888;
}
#simpleList li .fa-ellipsis-h {
display: block;
position: absolute;
top: 50%;
/*transform: translateY(-50%); removed*/
margin-top:-15px; /* added to fix the center*/
right: 30px;
font-size: 18px;
color: #888;
padding: 4px 13px;
border-radius: 5px;
border: 2px solid rgba(0, 0, 0, 0.1);
box-shadow: inset 0 0 5px 0 rgba(0, 0, 0, 0.1);
cursor: pointer;
/*z-index: 3; remove */
}
#simpleList li .fa-ellipsis-h .dropdown {
position: absolute;
display: none;
padding: 3px 0;
box-shadow: 0 0 10px 3px rgba(0, 0, 0, 0.15);
bottom: -70px;
right: 0;
min-width: 150px;
background-color: #fff;
z-index: 4;
}
#simpleList li .fa-ellipsis-h .dropdown::before {
content: '';
display: block;
width: 10px;
height: 10px;
transform-origin: center center;
transform: rotate(45deg);
position: absolute;
right: 17px;
top: -5px;
background-color: #fff;
}
#simpleList li .fa-ellipsis-h .dropdown div {
padding: 8px 15px;
color: #5b5b5b;
font-size: 14px;
font-weight: 400;
background-color: #fff;
position: relative;
}
#simpleList li .fa-ellipsis-h .dropdown div:hover {
background: #f0f0f0;
}
#simpleList li .kap {
display: flex;
flex-direction: column;
}
#simpleList li .kap .baslik {
font-weight: 700;
font-size: 18px;
margin: 0 0 10px 0;
}
#simpleList li .kap .tarih_cont {
display: flex;
color: #6f6f6f;
font-size: 14px;
}
#simpleList li .kap .tarih_cont .tire {
padding: 0 3px;
}
.display-block {
display: block !important;
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" />
<div class="bolumler">
<ul id="simpleList" class="list-group">
<li class="list-group-item">
<i class="fas fa-bars"></i>
<div class="kap">
<div class="baslik">Bolum 1</div>
<div class="tarih_cont">
<div class="tamamlandimi">Taslak</div>
<span class="tire">-</span>
<div class="tarih">May 09, 2019</div>
</div>
</div>
<div class="fas fa-ellipsis-h">
<div class="dropdown">
<div>Önizleme</div>
<div>Bölümü Sil</div>
</div>
</div>
</li>
<li class="list-group-item">
<i class="fas fa-bars"></i>
<div class="kap">
<div class="baslik">Bolum 2</div>
<div class="tarih_cont">
<div class="tamamlandimi">Taslak</div>
<span class="tire">-</span>
<div class="tarih">May 09, 2019</div>
</div>
</div>
<div class="fas fa-ellipsis-h">
<div class="dropdown">
<div>Önizleme</div>
<div>Bölümü Sil</div>
</div>
</div>
</li>
<li class="list-group-item">
<i class="fas fa-bars"></i>
<div class="kap">
<div class="baslik">Bolum 3</div>
<div class="tarih_cont">
<div class="tamamlandimi">Taslak</div>
<span class="tire">-</span>
<div class="tarih">May 09, 2019</div>
</div>
</div>
<div class="fas fa-ellipsis-h">
<div class="dropdown">
<div>Önizleme</div>
<div>Bölümü Sil</div>
</div>
</div>
</li>
<li class="list-group-item">
<i class="fas fa-bars"></i>
<div class="kap">
<div class="baslik">Bolum 4</div>
<div class="tarih_cont">
<div class="tamamlandimi">Taslak</div>
<span class="tire">-</span>
<div class="tarih">May 09, 2019</div>
</div>
</div>
<div class="fas fa-ellipsis-h">
<div class="dropdown">
<div>Önizleme</div>
<div>Bölümü Sil</div>
</div>
</div>
</li>
<li class="list-group-item">
<i class="fas fa-bars"></i>
<div class="kap">
<div class="baslik">Bolum 5</div>
<div class="tarih_cont">
<div class="tamamlandimi">Taslak</div>
<span class="tire">-</span>
<div class="tarih">May 09, 2019</div>
</div>
</div>
<div class="fas fa-ellipsis-h">
<div class="dropdown">
<div>Önizleme</div>
<div>Bölümü Sil</div>
</div>
</div>
</li>
</ul>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
Related:
I have position but z index is not working
css z-index issue with nested elements
Why can't an element with a z-index value cover its child?

I have this solution, this is hacky but it's working. I add .css('z-index', 1) in your js and remove the z-index from your css.
$('.fa-ellipsis-h').click(function() {
$(this)
.css('z-index', 1) // here
.children('.dropdown')
.toggleClass('display-block');
});
#simpleList {
margin: 0px;
width: 100%;
height: auto;
overflow: auto;
padding: 0;
}
#simpleList li {
list-style-type: none;
padding: 15px 20px 15px 80px;
position: relative;
cursor: normal;
}
#simpleList li:not(:last-child) {
border-bottom: 1px solid #e0e0e0;
}
#simpleList li i.fa-bars {
display: block;
position: absolute;
left: 30px;
top: 50%;
transform: translateY(-50%);
cursor: move;
font-size: 24px;
color: #888;
}
#simpleList li .fa-ellipsis-h {
display: block;
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 30px;
font-size: 18px;
color: #888;
padding: 4px 13px;
border-radius: 5px;
border: 2px solid rgba(0, 0, 0, 0.1);
box-shadow: inset 0 0 5px 0 rgba(0, 0, 0, 0.1);
cursor: pointer;
}
#simpleList li .fa-ellipsis-h .dropdown {
position: absolute;
display: none;
padding: 3px 0;
box-shadow: 0 0 10px 3px rgba(0, 0, 0, 0.15);
bottom: -70px;
right: 0;
min-width: 150px;
background-color: #fff;
}
#simpleList li .fa-ellipsis-h .dropdown::before {
content: '';
display: block;
width: 10px;
height: 10px;
transform-origin: center center;
transform: rotate(45deg);
position: absolute;
right: 17px;
top: -5px;
background-color: #fff;
}
#simpleList li .fa-ellipsis-h .dropdown div {
padding: 8px 15px;
color: #5b5b5b;
font-size: 14px;
font-weight: 400;
background-color: #fff;
position: relative;
}
#simpleList li .fa-ellipsis-h .dropdown div:hover {
background: #f0f0f0;
}
#simpleList li .kap {
display: flex;
flex-direction: column;
}
#simpleList li .kap .baslik {
font-weight: 700;
font-size: 18px;
margin: 0 0 10px 0;
}
#simpleList li .kap .tarih_cont {
display: flex;
color: #6f6f6f;
font-size: 14px;
}
#simpleList li .kap .tarih_cont .tire {
padding: 0 3px;
}
.display-block {
display: block !important;
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" />
<div class="bolumler">
<ul id="simpleList" class="list-group">
<li class="list-group-item">
<i class="fas fa-bars"></i>
<div class="kap">
<div class="baslik">Bolum 1</div>
<div class="tarih_cont">
<div class="tamamlandimi">Taslak</div>
<span class="tire">-</span>
<div class="tarih">May 09, 2019</div>
</div>
</div>
<div class="fas fa-ellipsis-h">
<div class="dropdown">
<div>Önizleme</div>
<div>Bölümü Sil</div>
</div>
</div>
</li>
<li class="list-group-item">
<i class="fas fa-bars"></i>
<div class="kap">
<div class="baslik">Bolum 2</div>
<div class="tarih_cont">
<div class="tamamlandimi">Taslak</div>
<span class="tire">-</span>
<div class="tarih">May 09, 2019</div>
</div>
</div>
<div class="fas fa-ellipsis-h">
<div class="dropdown">
<div>Önizleme</div>
<div>Bölümü Sil</div>
</div>
</div>
</li>
<li class="list-group-item">
<i class="fas fa-bars"></i>
<div class="kap">
<div class="baslik">Bolum 3</div>
<div class="tarih_cont">
<div class="tamamlandimi">Taslak</div>
<span class="tire">-</span>
<div class="tarih">May 09, 2019</div>
</div>
</div>
<div class="fas fa-ellipsis-h">
<div class="dropdown">
<div>Önizleme</div>
<div>Bölümü Sil</div>
</div>
</div>
</li>
<li class="list-group-item">
<i class="fas fa-bars"></i>
<div class="kap">
<div class="baslik">Bolum 4</div>
<div class="tarih_cont">
<div class="tamamlandimi">Taslak</div>
<span class="tire">-</span>
<div class="tarih">May 09, 2019</div>
</div>
</div>
<div class="fas fa-ellipsis-h">
<div class="dropdown">
<div>Önizleme</div>
<div>Bölümü Sil</div>
</div>
</div>
</li>
<li class="list-group-item">
<i class="fas fa-bars"></i>
<div class="kap">
<div class="baslik">Bolum 5</div>
<div class="tarih_cont">
<div class="tamamlandimi">Taslak</div>
<span class="tire">-</span>
<div class="tarih">May 09, 2019</div>
</div>
</div>
<div class="fas fa-ellipsis-h">
<div class="dropdown">
<div>Önizleme</div>
<div>Bölümü Sil</div>
</div>
</div>
</li>
</ul>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>

Related

How to change arrow rotation when select box is active using CSS

Basically, i'm creating a custom select box when i finished the design part using css and when i wanted to add the "before" and "active" options so that the "arrow" and "menu" changes when the select box is active, I had some problems, when i add "active" to the class name in the browser the arrow is supposed to rotate but nothing happens instead.
HTML
<div class="custom_select_box_1_index">
<ul id="DefaultCategoryIndex"class="default_option_category_index">
<li>
<div class="option_allcategories">
<p>All Categories</p>
<i id="ArrowCategoryIndex" class="fa fa-chevron-up"></i>
</div>
</li>
</ul>
<ul id="OptionsCategoryIndex" class="select_option_category_index">
<li>
<div id="CategoryObjects" class="option objects">
<div class="icon"><i id="icon" class="fas fa-cube"></i></div>
<p class="category_text">Objects</p>
</div>
</li>
<li>
<div id="CategoryVehicules" class="option vehicules">
<div class="icon"><i id="icon" class="fas fa-car"></i></div>
<p class="category_text">Vehicules</p>
</div>
</li>
<li>
<div id="CategoryTechnology" class="option technology">
<div class="icon"><i id="icon" class="fas fa-mobile"></i></div>
<p class="category_text">Technology</p>
</div>
</li>
<li>
<div id="CategoryBooks" class="option books">
<div class="icon"><i id="icon" class="fas fa-book"></i></div>
<p class="category_text">Books</p>
</div>
</li>
<li>
<div id="CategoryGaming" class="option gaming">
<div class="icon"><i id="icon" class="fas fa-gamepad"></i></div>
<p class="category_text">Gaming</p>
</div>
</li>
<li>
<div id="CategoryOther" class="option other">
<div class="icon"><i id="icon" class="fas fa-ellipsis-h"></i></div>
<p class="category_text">Other...</p>
</div>
</li>
</ul>
</div>
CSS:
.custom_select_box_1_index{
font-family: Helvetica;
font-size: 19px;
color: var(--second-black);
box-sizing: content-box;
width: 250px;
height: 50px;
}
.custom_select_box_1_index > ul li{
list-style: none;
}
.custom_select_box_1_index .default_option_category_index:before{
content: "";
padding-top: 1px;
padding-bottom: 1px;
border-radius: 10px;
background-color: var(--white);
box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.05);
cursor: pointer;
transform: rotate(180deg);
color: var(--black);
position: absolute;
margin-left: 170px;
margin-top: -39px;
cursor: pointer;
}
.custom_select_box_1_index .select_option_category_index{
background-color: var(--white);
border-radius: 10px;
box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.05);
z-index: 1;
display: none
}
.select_option_category_index li{
position: relative;
margin-left: -38px;
background-color: var(--white);
border-radius: 10px;
width: 230px;
padding: 3px 8px;
cursor: pointer;
}
.custom_select_box_1_index .select_option_category_index li:hover{
background: var(--grey);
}
.category_text{
position: relative;
left: 30px;
}
.custom_select_box_1_index .option{
display: flex;
align-items: center;
}
.icon{
display: flex;
align-items: center;
margin-left: 15px;
}
#icon{
color: var(--black);
}
.custom_select_box_1_index:active .select_option_category_index{
display: block;
}
.custom_select_box_1_index:active .default_option_category_index:before{
transform: rotate(0deg);
}
I want the arrow to rotate back to 0deg when the select bar is active (without using JavaScript).
You can leverage the CSS adjacent sibling selector +:
.custom_select_box_1_index {
font-family: Helvetica;
font-size: 19px;
color: var(--second-black);
box-sizing: content-box;
width: 250px;
height: 50px;
}
.custom_select_box_1_index>ul li {
list-style: none;
}
.custom_select_box_1_index .default_option_category_index:before {
content: "";
padding-top: 1px;
padding-bottom: 1px;
border-radius: 10px;
background-color: var(--white);
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.05);
cursor: pointer;
transform: rotate(180deg);
color: var(--black);
position: absolute;
margin-left: 170px;
margin-top: -39px;
cursor: pointer;
}
.custom_select_box_1_index .select_option_category_index {
background-color: var(--white);
border-radius: 10px;
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.05);
z-index: 1;
display: none
}
.select_option_category_index li {
position: relative;
margin-left: -38px;
background-color: var(--white);
border-radius: 10px;
width: 230px;
padding: 3px 8px;
cursor: pointer;
}
.custom_select_box_1_index .select_option_category_index li:hover {
background: var(--grey);
}
.category_text {
position: relative;
left: 30px;
}
.custom_select_box_1_index .option {
display: flex;
align-items: center;
}
.icon {
display: flex;
align-items: center;
margin-left: 15px;
}
#icon {
color: var(--black);
}
.custom_select_box_1_index:active .select_option_category_index {
display: block;
}
.custom_select_box_1_index:active .default_option_category_index:before {
transform: rotate(90deg);
}
.option_allcategories p:active+.fa-chevron-up {
transform: rotate(180deg);
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" referrerpolicy="no-referrer"
/>
<div class="custom_select_box_1_index">
<ul id="DefaultCategoryIndex" class="default_option_category_index">
<li>
<div class="option_allcategories">
<p>All Categories</p>
<i id="ArrowCategoryIndex" class="fa fa-chevron-up"></i>
</div>
</li>
</ul>
<ul id="OptionsCategoryIndex" class="select_option_category_index">
<li>
<div id="CategoryObjects" class="option objects">
<div class="icon"><i id="icon" class="fas fa-cube"></i></div>
<p class="category_text">Objects</p>
</div>
</li>
<li>
<div id="CategoryVehicules" class="option vehicules">
<div class="icon"><i id="icon" class="fas fa-car"></i></div>
<p class="category_text">Vehicules</p>
</div>
</li>
<li>
<div id="CategoryTechnology" class="option technology">
<div class="icon"><i id="icon" class="fas fa-mobile"></i></div>
<p class="category_text">Technology</p>
</div>
</li>
<li>
<div id="CategoryBooks" class="option books">
<div class="icon"><i id="icon" class="fas fa-book"></i></div>
<p class="category_text">Books</p>
</div>
</li>
<li>
<div id="CategoryGaming" class="option gaming">
<div class="icon"><i id="icon" class="fas fa-gamepad"></i></div>
<p class="category_text">Gaming</p>
</div>
</li>
<li>
<div id="CategoryOther" class="option other">
<div class="icon"><i id="icon" class="fas fa-ellipsis-h"></i></div>
<p class="category_text">Other...</p>
</div>
</li>
</ul>
</div>

Bootstrap Vertical timeline to Horizontal timeline

I have created a vertical timeline that needs to be changed completely into horizontal timeline I'm trying to get it horizontal but it doesn't work as expected.
Posted the complete CSS & HTML code also link to codepen of the current progress.
Also, the timeline needs to be responsive in horizontal view.
Link
https://codepen.io/anon/pen/yvPLrP
#Timline {
background-color: #FFFFFF;
}
.Timline-wrapper {
position: relative;
clear: both;
overflow: hidden;
}
.Timline-wrapper:nth-of-type(odd) .Timline-item {
padding-left: 100px;
padding-right: 0;
padding-bottom: 50px;
float: right;
}
.Timline-wrapper:nth-of-type(odd) .Timline-box:after {
left: -20px;
right: auto;
border-color: transparent;
text-align: left;
border-right: 10px solid #fff;
border-left-color: transparent !important;
}
.Timline-wrapper:nth-of-type(odd) .Timline-icon {
right: auto;
left: -32px;
}
.Timline-wrapper:nth-of-type(odd) .Timline-year {
text-align: right;
right: 140%;
left: auto;
}
.Timline-holder:before {
content: '';
position: absolute;
top: 0;
left: 50%;
margin-left: -4px;
height: 100%;
width: 4px;
background: #939393;
opacity: 0.5;
}
.Timline-item {
padding-right: 100px;
padding-bottom: 50px;
padding-top: 50px;
}
.Timline-year {
top: 40px;
position: absolute;
width: 100%;
left: 140%;
}
.Timline-year>* {
margin: 0;
}
.Timline-icon {
border-radius: 50%;
background: #fff;
position: absolute;
width: 60px;
height: 60px;
right: -28px;
top: 72px;
z-index: 9;
cursor: pointer;
border: 2px solid transparent;
transition: all 0.3s ease-in-out;
}
.Timline-icon:before {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.Timline-icon:hover {
color: #E3000F;
border: 2px solid #E3000F;
transform: translateY(-6px);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}
.Timline-box {
background-color: #fff;
padding: 15px;
position: relative;
}
.Timline-box h3,
.Timline-box h5 {
text-transform: capitalize;
}
.Timline-box:after {
content: "";
display: block;
position: absolute;
right: -20px;
top: 40px;
border: 10px solid transparent;
border-left: 10px solid #fff;
}
.Timline-box:hover {
cursor: pointer;
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}
.Timline-box:hover+.Timline-icon {
color: #E3000F;
border: 2px solid #E3000F;
transform: translateY(-6px);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}
.Timline-box {
background-color: #fff;
padding: 15px;
}
/* Timline Responsive */
#media (min-width: 992px) and (max-width: 1024px) {
.Timline-year {
left: 152%;
}
.Timline-wrapper:nth-of-type(odd) .Timline-year {
right: 152%;
}
}
#media (max-width: 768px) {
.Timline-item {
padding-right: 15px;
margin-left: 65px;
padding-top: 20px;
}
.Timline-holder:before {
left: 37px;
}
.Timline-icon {
left: -60px;
right: auto;
top: 42px;
}
.Timline-year {
position: relative;
top: 0;
left: 0;
}
.Timline-box:after {
left: -20px;
right: auto;
border-color: transparent;
text-align: left;
border-right: 10px solid #fff;
border-left-color: transparent !important;
}
.Timline-wrapper:nth-of-type(odd) .Timline-item {
padding-right: 15px;
padding-left: 15px;
margin-left: 65px;
float: none;
}
.Timline-wrapper:nth-of-type(odd) .Timline-icon {
left: -60px;
right: auto;
}
.Timline-wrapper:nth-of-type(odd) .Timline-year {
position: relative;
top: 0;
left: 0;
text-align: left;
}
}
<!-- Timline Section -->
<section id="Timline">
<div class="container">
<div class="section-content">
<div class="row">
<!-- Section Title -->
<div class="col-md-12 section-title text-center">
<span class="divider center"></span>
<h2>Timline</h2>
</div>
<!-- End of Section Title -->
<!-- Timline-1 -->
<div class="Timline-wrapper">
<div class="col-md-12 Timline-holder">
<div class="row">
<div class="col-md-6 col-sm-12 Timline-item">
<div class="Timline-box" data-aos="fade-right">
<h3>One</h3>
</div>
<i class=" Timline-icon fa fa-2x fa-paint-brush"></i>
</div>
</div>
</div>
</div>
<!-- End of Timline-1 -->
<!-- Timline-2 -->
<div class="Timline-wrapper">
<div class="col-md-12 Timline-holder">
<div class="row">
<div class="col-md-6 col-sm-12 Timline-item">
<div class=" Timline-box" data-aos="fade-right">
<h3>Two</h3>
</div>
<i class=" Timline-icon fa fa-2x fa-star"></i>
</div>
</div>
</div>
</div>
<!-- End of Timline-2 -->
<!-- Timline-3 -->
<div class="Timline-wrapper">
<div class="col-md-12 Timline-holder">
<div class="row">
<div class="col-md-6 col-sm-12 Timline-item">
<div class=" Timline-box" data-aos="fade-right">
<h3>Three</h3>
</div>
<i class=" Timline-icon fa fa-2x fa-lightbulb-o"></i>
</div>
</div>
</div>
</div>
<!-- End of Timline-3 -->
<!-- Timline-4 -->
<div class="Timline-wrapper">
<div class="col-md-12 Timline-holder">
<div class="row">
<div class="col-md-6 col-sm-12 Timline-item">
<div class=" Timline-box" data-aos="fade-right">
<h3>Four</h3>
</div>
<i class=" Timline-icon fa fa-2x fa-star"></i>
</div>
</div>
</div>
</div>
<!-- End of Timline-4 -->
<!-- Timline-5 -->
<div class="Timline-wrapper">
<div class="col-md-12 Timline-holder">
<div class="row">
<div class="col-md-6 col-sm-12 Timline-item">
<div class=" Timline-box" data-aos="fade-right">
<h3>Five</h3>
</div>
<i class=" Timline-icon fa fa-2x fa-paint-brush"></i>
</div>
</div>
</div>
</div>
<!-- End of Timline-5 -->
<!-- Timline-6 -->
<div class="Timline-wrapper">
<div class="col-md-12 Timline-holder">
<div class="row">
<div class="col-md-6 col-sm-12 Timline-item">
<div class=" Timline-box" data-aos="fade-right">
<h3>Six</h3>
</div>
<i class=" Timline-icon fa fa-2x fa-star"></i>
</div>
</div>
</div>
</div>
<!-- End of Timline-6 -->
<!-- Timline-7 -->
<div class="Timline-wrapper">
<div class="col-md-12 Timline-holder">
<div class="row">
<div class="col-md-6 col-sm-12 Timline-item">
<div class=" Timline-box" data-aos="fade-right">
<h3>Seven</h3>
</div>
<i class=" Timline-icon fa fa-2x fa-lightbulb-o"></i>
</div>
</div>
</div>
</div>
<!-- End of Timline-7 -->
<!-- Timline-8 -->
<div class="Timline-wrapper">
<div class="col-md-12 Timline-holder">
<div class="row">
<div class="col-md-6 col-sm-12 Timline-item">
<div class=" Timline-box" data-aos="fade-right">
<h3>Eight</h3>
</div>
<i class=" Timline-icon fa fa-2x fa-star"></i>
</div>
</div>
</div>
</div>
<!-- End of Timline-8 -->
<!-- Timline-9 -->
<div class="Timline-wrapper">
<div class="col-md-12 Timline-holder">
<div class="row">
<div class="col-md-6 col-sm-12 Timline-item">
<div class=" Timline-box" data-aos="fade-right">
<h3>Nine</h3>
</div>
<i class=" Timline-icon fa fa-2x fa-lightbulb-o"></i>
</div>
</div>
</div>
</div>
<!-- End of Timline-9 -->
</div>
</div>
</div>
</section>
<!-- End of Timline Section -->
You can modify this based on your requirement
/* Timeline */
.timeline,
.timeline-horizontal {
list-style: none;
padding: 20px;
position: relative;
}
.timeline:before {
top: 40px;
bottom: 0;
position: absolute;
content: " ";
width: 3px;
background-color: #eeeeee;
left: 50%;
margin-left: -1.5px;
}
.timeline .timeline-item {
margin-bottom: 20px;
position: relative;
}
.timeline .timeline-item:before,
.timeline .timeline-item:after {
content: "";
display: table;
}
.timeline .timeline-item:after {
clear: both;
}
.timeline .timeline-item .timeline-badge {
color: #fff;
width: 54px;
height: 54px;
line-height: 52px;
font-size: 22px;
text-align: center;
position: absolute;
top: 18px;
left: 50%;
margin-left: -25px;
background-color: #7c7c7c;
border: 3px solid #ffffff;
z-index: 100;
border-top-right-radius: 50%;
border-top-left-radius: 50%;
border-bottom-right-radius: 50%;
border-bottom-left-radius: 50%;
}
.timeline .timeline-item .timeline-badge i,
.timeline .timeline-item .timeline-badge .fa,
.timeline .timeline-item .timeline-badge .glyphicon {
top: 2px;
left: 0px;
}
.timeline .timeline-item .timeline-badge.primary {
background-color: #1f9eba;
}
.timeline .timeline-item .timeline-badge.info {
background-color: #5bc0de;
}
.timeline .timeline-item .timeline-badge.success {
background-color: #59ba1f;
}
.timeline .timeline-item .timeline-badge.warning {
background-color: #d1bd10;
}
.timeline .timeline-item .timeline-badge.danger {
background-color: #ba1f1f;
}
.timeline .timeline-item .timeline-panel {
position: relative;
width: 46%;
float: left;
right: 16px;
border: 1px solid #c0c0c0;
background: #ffffff;
border-radius: 2px;
padding: 20px;
-webkit-box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175);
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175);
}
.timeline .timeline-item .timeline-panel:before {
position: absolute;
top: 26px;
right: -16px;
display: inline-block;
border-top: 16px solid transparent;
border-left: 16px solid #c0c0c0;
border-right: 0 solid #c0c0c0;
border-bottom: 16px solid transparent;
content: " ";
}
.timeline .timeline-item .timeline-panel .timeline-title {
margin-top: 0;
color: inherit;
}
.timeline .timeline-item .timeline-panel .timeline-body>p,
.timeline .timeline-item .timeline-panel .timeline-body>ul {
margin-bottom: 0;
}
.timeline .timeline-item .timeline-panel .timeline-body>p+p {
margin-top: 5px;
}
.timeline .timeline-item:last-child:nth-child(even) {
float: right;
}
.timeline .timeline-item:nth-child(even) .timeline-panel {
float: right;
left: 16px;
}
.timeline .timeline-item:nth-child(even) .timeline-panel:before {
border-left-width: 0;
border-right-width: 14px;
left: -14px;
right: auto;
}
.timeline-horizontal {
list-style: none;
position: relative;
padding: 20px 0px 20px 0px;
display: inline-block;
}
.timeline-horizontal:before {
height: 3px;
top: auto;
bottom: 26px;
left: 56px;
right: 0;
width: 100%;
margin-bottom: 20px;
}
.timeline-horizontal .timeline-item {
display: table-cell;
height: 280px;
width: 20%;
min-width: 320px;
float: none !important;
padding-left: 0px;
padding-right: 20px;
margin: 0 auto;
vertical-align: bottom;
}
.timeline-horizontal .timeline-item .timeline-panel {
top: auto;
bottom: 64px;
display: inline-block;
float: none !important;
left: 0 !important;
right: 0 !important;
width: 100%;
margin-bottom: 20px;
}
.timeline-horizontal .timeline-item .timeline-panel:before {
top: auto;
bottom: -16px;
left: 28px !important;
right: auto;
border-right: 16px solid transparent !important;
border-top: 16px solid #c0c0c0 !important;
border-bottom: 0 solid #c0c0c0 !important;
border-left: 16px solid transparent !important;
}
.timeline-horizontal .timeline-item:before,
.timeline-horizontal .timeline-item:after {
display: none;
}
.timeline-horizontal .timeline-item .timeline-badge {
top: auto;
bottom: 0px;
left: 43px;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet" />
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="page-header">
<h1>Horizontal timeline</h1>
</div>
<div style="display:inline-block;width:100%;overflow-y:auto;">
<ul class="timeline timeline-horizontal">
<li class="timeline-item">
<div class="col-md-12 Timline-holder">
<div class="row">
<div class="col-md-6 col-sm-12 Timline-item">
<div class=" Timline-box" data-aos="fade-right">
<h3>One</h3>
</div>
<i class=" Timline-icon fa fa-2x fa-lightbulb-o"></i>
</div>
</div>
</div>
</li>
<li class="timeline-item">
<div class="col-md-12 Timline-holder">
<div class="row">
<div class="col-md-6 col-sm-12 Timline-item">
<div class=" Timline-box" data-aos="fade-right">
<h3>Two</h3>
</div>
<i class=" Timline-icon fa fa-2x fa-lightbulb-o"></i>
</div>
</div>
</div>
</li>
<li class="timeline-item">
<div class="col-md-12 Timline-holder">
<div class="row">
<div class="col-md-6 col-sm-12 Timline-item">
<div class=" Timline-box" data-aos="fade-right">
<h3>Three</h3>
</div>
<i class=" Timline-icon fa fa-2x fa-lightbulb-o"></i>
</div>
</div>
</div>
</li>
<li class="timeline-item">
<div class="col-md-12 Timline-holder">
<div class="row">
<div class="col-md-6 col-sm-12 Timline-item">
<div class=" Timline-box" data-aos="fade-right">
<h3>Four</h3>
</div>
<i class=" Timline-icon fa fa-2x fa-lightbulb-o"></i>
</div>
</div>
</div>
</li>
<li class="timeline-item">
<div class="col-md-12 Timline-holder">
<div class="row">
<div class="col-md-6 col-sm-12 Timline-item">
<div class=" Timline-box" data-aos="fade-right">
<h3>Five</h3>
</div>
<i class=" Timline-icon fa fa-2x fa-lightbulb-o"></i>
</div>
</div>
</div>
</li>
<li class="timeline-item">
<div class="col-md-12 Timline-holder">
<div class="row">
<div class="col-md-6 col-sm-12 Timline-item">
<div class=" Timline-box" data-aos="fade-right">
<h3>Six</h3>
</div>
<i class=" Timline-icon fa fa-2x fa-lightbulb-o"></i>
</div>
</div>
</div>
</li>
<li class="timeline-item">
<div class="col-md-12 Timline-holder">
<div class="row">
<div class="col-md-6 col-sm-12 Timline-item">
<div class=" Timline-box" data-aos="fade-right">
<h3>Seven
</h3>
</div>
<i class=" Timline-icon fa fa-2x fa-lightbulb-o"></i>
</div>
</div>
</div>
</li>
<li class="timeline-item">
<div class="col-md-12 Timline-holder">
<div class="row">
<div class="col-md-6 col-sm-12 Timline-item">
<div class=" Timline-box" data-aos="fade-right">
<h3>Eight</h3>
</div>
<i class=" Timline-icon fa fa-2x fa-lightbulb-o"></i>
</div>
</div>
</div>
</li>
<li class="timeline-item">
<div class="col-md-12 Timline-holder">
<div class="row">
<div class="col-md-6 col-sm-12 Timline-item">
<div class=" Timline-box" data-aos="fade-right">
<h3>Nine</h3>
</div>
<i class=" Timline-icon fa fa-2x fa-lightbulb-o"></i>
</div>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>

Bootstrap- elements overlap on extra small size

I have recent-posts div that show two post with their images and text. after recent-posts I have another div contact-us that contain an image and some text. My issue appear in extra-small size where recent-posts posts go under contact-us part. How can I fix that? The following is my codes and JsFiddle.
HTML:
<div id="recent-posts" class="center-block row">
<div class="posts col-md-3 col-sm-5 col-xs-9">
<div class="posts-div">
<div class="img-hover">
<img src="images/post1.jpg" class="img-responsive">
<div class="overlay col-md-12 col-xs-12">
<div>
<span class="fa fa-2x fa-square post-icon" ><span class="fa fa-heart"></span></span>
<span class="fa fa-2x fa-square post-icon" ><span>16</span></span>
</div>
<div>
<span class="fa fa-2x fa-square post-icon" ><span class="fa fa-eye"></span></span>
<span class="fa fa-2x fa-square post-icon" ><span>16</span></span>
</div>
</div>
</div>
<p class="text-center">dsfdsfsdfldshfdskfhdsf</div>
</div>
<div class="posts col-md-3 col-sm-5 col-xs-9">
<div class="posts-div">
<div class="img-hover">
<img src="images/post2.jpg" class="img-responsive">
<div class="overlay col-md-12 col-xs-12">
<div>
<span class="fa fa-2x fa-square post-icon" ><span class="fa fa-heart "></span></span>
<span class="fa fa-2x fa-square post-icon" ><span>16</span></span>
</div>
<div>
<span class="fa fa-2x fa-square post-icon" ><span class="fa fa-eye "></span></span>
<span class="fa fa-2x fa-square post-icon" ><span>16</span></span>
</div>
</div>
</div>
<p class="text-center">dsjkfhjdssafjsdkjhfdsf</p>
</div>
</div>
</div>
<div id="contact-us" class="row">
<div class="col-md-12 col-xs-12">
<img src="http://www.infocurse.com/wp-content/uploads/2014/11/716988156_1368083660.png" class="img-responsive">
<div id="contact-us-text">
<p>sdkf,sd,kfnds,nf,d.....</p>
<p>kdsfnks,dnf,ksdnf,kdsnf,kdsnf,d</p>
<button class="btn btn-success pull-left">124234234</button>
</div>
</div>
</div>
Css:
#recent-posts{
height: 350px;
display: flex;
justify-content: center;
position: relative;
flex-wrap: wrap;
margin-bottom: 100px;
}
.posts{
display: flex;
flex-direction: column;
height: 350px;
margin-top: 20px;
position: relative;
border-radius: 5px;
box-shadow: 1px 1px 5px #888888;
padding: 0;
margin-left: 20px;
margin-right: 20px;
}
.posts img{
border-radius: 5px 5px 0 0;
cursor: pointer;
}
.posts .btn-success{
position: absolute;
background-color: #01a89e;
width: 50%;
color: #101010;
cursor: auto;
margin-top: -17px;
margin-right: 25%;
}
.posts .btn-success:active{
background-color: #01a89e;
color: #101010;
box-shadow: none;
}
.posts p{
margin-top: 30px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.overlay {
position: absolute;
top: 0;
bottom: 100%;
left: 0;
right: 0;
background-color: rgba(46, 183, 175, .7);
overflow: hidden;
height:0;
transition: .8s ease;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
border-radius: 5px 5px 0 0;
}
.overlay div:first-child{
margin-left: 15px;
}
.posts-div:hover .overlay {
bottom: 0;
top: 0;
height: auto;
overflow: hidden;
}
.img-hover{
position: relative;
}
.post-icon{
color: rgba(255, 255, 255, 1);
transform: rotate(45deg);
opacity: 1;
}
.post-icon span{
transform: rotate(-45deg);
font-size: 12px;
position: absolute;
left: 50%;
top: 0.6em;
margin-left: -7px;
color: #101010;
font-weight: bold;
}
.fa-heart{
color: red !important;
}
#contact-us{
height: 200px;
margin-bottom: 30px;
box-shadow: 0 1px 5px #666666, 0 -1px 5px #666666;
position: relative;
padding: 0;
overflow: hidden;
}
#contact-us-text{
position: absolute;
top: 20%;
left: 12%;
}
#contact-us-text p{
color: white;
}
#contact-us-text .btn-success{
background-color: #01a89e;
cursor: auto;
}
#contact-us-text .btn-success:active{
background-color: #01a89e;
box-shadow: none;
}
JsFiddle
Recent-posts class has a fixed height.
#recent-posts{
height: 350px; // THIS LINE IS THE REASON!
display: flex;
justify-content: center;
position: relative;
flex-wrap: wrap;
margin-bottom: 100px;
}
Updated fiddle

How do I fit my element inside a container div

So I have an interface where I want a sidemenu to the left, and the rest of the area should contain a chat-field. The problem is that the chat-field is overflowing the container, and half of the chat-field goes outside the container div.
How do I fit the chat-field in the container with these settings? The container is named #chat-canvas
Here's a JSFiddle: https://jsfiddle.net/v5k1Lhgf/1/
* {
margin: 0;
padding: 0;
box-sizing: border-box !important;
}
html, body, #body {
background-color: #ffffff;
font-size: 15px;
color: #565656;
width: 100%;
padding: 0;
margin-left: 0;
margin-right: 0;
font-family: 'roboto', sans-serif;
font-weight: 300;
}
#body, .app html, body {
background-color: #f9f9f9;
font-size: 15px;
color: #565656;
width: 100%;
height: 100%;
padding: 0;
margin-left: 0;
margin-right: 0;
font-family: 'roboto', sans-serif;
font-weight: 300;
min-height: 100%;
}
html {
font-size: 10px;
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
transition: all 3s ease-in-out;
height: 100%;
min-height: 100%;
}
*,*:before,*:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#chat-canvas {
width: 94% !important;
height: 100%;
position: absolute;
float: left;
display: inline-block;
overflow: hidden;
}
.app-nav {
position: relative;
height: 100%;
width: 6%;
display: inline-block;
}
.tl-menu {
position: absolute;
overflow: hidden;
float: left;
top: 0;
height: 100%;
list-style-type: none;
margin: 0;
padding: 0;
background: #1b1e24;
z-index: 9999;
}
.tl-menu img{
max-height: 80%;
}
.tl-menu li a {
display: block;
height: 5em;
width: 5em;
line-height: 5em;
text-align: center;
color: #999;
position: relative;
border-bottom: 1px solid rgba(104,114,134,0.05);
-webkit-transition: background 0.1s ease-in-out;
-moz-transition: background 0.1s ease-in-out;
transition: background 0.1s ease-in-out;
}
.tl-menu li a:hover,
.tl-menu li:first-child a{
color: #55fec6;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
}
.tl-menu li a:active {
background: #afdefa;
color: #FFF;}
/* class for current item */
.tl-menu li.tl-current a {
background: #343a47;
color: #bbe6fe;
}
.tl-menu li a:before {
font-family: 'entypo', sans-serif;
speak: none;
font-style: normal;
font-weight: normal;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
font-size: 1.4em;
-webkit-font-smoothing: antialiased;
}
.tl-menu li a.icon-logo:before {
font-weight: 700;
font-size: 300%;
}
/* ---------- CHAT ---------- */
.people-list {
width: 30%;
float: right;
}
.people-list .search {
padding: 20px;
}
.people-list input {
border-radius: 3px;
border: none;
padding: 14px;
color: white;
background: #6A6C75;
width: 90%;
font-size: 14px;
}
.people-list .fa-search {
position: relative;
left: -25px;
}
.people-list ul {
padding: 20px;
height: 770px;
}
.people-list ul li {
padding-bottom: 20px;
}
.people-list img {
float: left;
}
.people-list .about {
float: left;
margin-top: 8px;
}
.people-list .about {
padding-left: 8px;
}
.people-list .status {
color: #92959E;
}
.chat {
width: 70%;
float: left;
position: absolute;
background: #F2F5F8;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
color: #434651;
}
.chat .chat-header {
padding: 20px;
border-bottom: 2px solid white;
}
.chat .chat-header img {
float: left;
}
.chat .chat-header .chat-about {
float: left;
padding-left: 10px;
margin-top: 6px;
}
.chat .chat-header .chat-with {
font-weight: bold;
font-size: 16px;
}
.chat .chat-header .chat-num-messages {
color: #92959E;
}
.chat .chat-header .fa-star {
float: right;
color: #D8DADF;
font-size: 20px;
margin-top: 12px;
}
.chat .chat-history {
padding: 30px 30px 20px;
border-bottom: 2px solid white;
overflow-y: scroll;
height: 575px;
}
.chat .chat-history .message-data {
margin-bottom: 15px;
}
.chat .chat-history .message-data-time {
color: #a8aab1;
padding-left: 6px;
}
.chat .chat-history .message {
color: white;
padding: 18px 20px;
line-height: 26px;
font-size: 16px;
border-radius: 7px;
margin-bottom: 30px;
width: 90%;
position: relative;
}
.chat .chat-history .message:after {
bottom: 100%;
left: 7%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
border-bottom-color: #86BB71;
border-width: 10px;
margin-left: -10px;
}
.chat .chat-history .my-message {
background: #86BB71;
}
.chat .chat-history .other-message {
background: #94C2ED;
}
.chat .chat-history .other-message:after {
border-bottom-color: #94C2ED;
left: 93%;
}
.chat .chat-message {
padding: 30px;
}
.chat .chat-message textarea {
width: 100%;
border: none;
padding: 10px 20px;
font: 14px/22px "Lato", Arial, sans-serif;
margin-bottom: 10px;
border-radius: 5px;
resize: none;
}
.chat .chat-message .fa-file-o, .chat .chat-message .fa-file-image-o {
font-size: 16px;
color: gray;
cursor: pointer;
}
.chat .chat-message button {
float: right;
color: #94C2ED;
font-size: 16px;
text-transform: uppercase;
border: none;
cursor: pointer;
font-weight: bold;
background: #F2F5F8;
}
.chat .chat-message button:hover {
color: #75b1e8;
}
.online, .offline, .me {
margin-right: 3px;
font-size: 10px;
}
.online {
color: #86BB71;
}
.offline {
color: #E38968;
}
.me {
color: #94C2ED;
}
.align-left {
text-align: left;
}
.align-right {
text-align: right;
}
.float-right {
float: right;
}
.clearfix:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
.chat-container {
bottom: 0;
left: 0;
right: 0;
height: auto;
margin: 0 auto;
width: 750px;
background: #444753;
border-radius: 5px;
}
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/>
<body class="app">
<!-- NAV -->
<div class="app-nav">
<ul class="tl-menu">
<li><img src="https://i.imgur.com/ngO5Ohx.png" alt="Mendr Logo" height="50" width="50"></li>
<li><img src="{{user.picture}}"></li>
<li><i class="fa fa-plus" style="font-size:30px; margin-top:20px;"></i></li>
<li><i class="fa fa-wechat" style="font-size:30px; margin-top:20px;"></i></li>
<li><i class="fa fa-map" style="font-size:30px; margin-top:20px;"></i></li>
<li><i class="fa fa-search" style="font-size:30px; margin-top:20px;"></i></li>
<li><i class="fa fa-sign-out" style="font-size:30px; margin-top:20px;"></i></li>
</ul>
</div>
<!-- END NAV -->
<!-- CHAT -->
<div id="chat-canvas">
<div class="clearfix chat-container">
<div class="people-list" id="people-list">
<div class="search">
<input type="text" placeholder="search" />
<i class="fa fa-search"></i>
</div>
<ul class="list">
<li class="clearfix">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/chat_avatar_01.jpg" alt="avatar" />
<div class="about">
<div class="name">Vincent Porter</div>
<div class="status">
<i class="fa fa-circle online"></i> online
</div>
</div>
</li>
<li class="clearfix">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/chat_avatar_02.jpg" alt="avatar" />
<div class="about">
<div class="name">Aiden Chavez</div>
<div class="status">
<i class="fa fa-circle offline"></i> left 7 mins ago
</div>
</div>
</li>
<li class="clearfix">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/chat_avatar_03.jpg" alt="avatar" />
<div class="about">
<div class="name">Mike Thomas</div>
<div class="status">
<i class="fa fa-circle online"></i> online
</div>
</div>
</li>
<li class="clearfix">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/chat_avatar_04.jpg" alt="avatar" />
<div class="about">
<div class="name">Erica Hughes</div>
<div class="status">
<i class="fa fa-circle online"></i> online
</div>
</div>
</li>
<li class="clearfix">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/chat_avatar_05.jpg" alt="avatar" />
<div class="about">
<div class="name">Ginger Johnston</div>
<div class="status">
<i class="fa fa-circle online"></i> online
</div>
</div>
</li>
<li class="clearfix">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/chat_avatar_06.jpg" alt="avatar" />
<div class="about">
<div class="name">Tracy Carpenter</div>
<div class="status">
<i class="fa fa-circle offline"></i> left 30 mins ago
</div>
</div>
</li>
<li class="clearfix">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/chat_avatar_07.jpg" alt="avatar" />
<div class="about">
<div class="name">Christian Kelly</div>
<div class="status">
<i class="fa fa-circle offline"></i> left 10 hours ago
</div>
</div>
</li>
<li class="clearfix">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/chat_avatar_08.jpg" alt="avatar" />
<div class="about">
<div class="name">Monica Ward</div>
<div class="status">
<i class="fa fa-circle online"></i> online
</div>
</div>
</li>
<li class="clearfix">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/chat_avatar_09.jpg" alt="avatar" />
<div class="about">
<div class="name">Dean Henry</div>
<div class="status">
<i class="fa fa-circle offline"></i> offline since Oct 28
</div>
</div>
</li>
<li class="clearfix">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/chat_avatar_10.jpg" alt="avatar" />
<div class="about">
<div class="name">Peyton Mckinney</div>
<div class="status">
<i class="fa fa-circle online"></i> online
</div>
</div>
</li>
</ul>
</div>
<div class="activity-info">
<div class="chat">
<div class="chat-header clearfix">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/chat_avatar_01_green.jpg" alt="avatar" />
<div class="chat-about">
<div class="chat-with">Chat with Vincent Porter</div>
<div class="chat-num-messages">already 1 902 messages</div>
</div>
<i class="fa fa-star"></i>
</div> <!-- end chat-header -->
<div class="chat-history">
<ul>
<li class="clearfix">
<div class="message-data align-right">
<span class="message-data-time" >10:10 AM, Today</span>
<span class="message-data-name" >Olia</span> <i class="fa fa-circle me"></i>
</div>
<div class="message other-message float-right">
Hi Vincent, how are you? How is the project coming along?
</div>
</li>
<li>
<div class="message-data">
<span class="message-data-name"><i class="fa fa-circle online"></i> Vincent</span>
<span class="message-data-time">10:12 AM, Today</span>
</div>
<div class="message my-message">
Are we meeting today? Project has been already finished and I have results to show you.
</div>
</li>
<li class="clearfix">
<div class="message-data align-right">
<span class="message-data-time" >10:14 AM, Today</span>
<span class="message-data-name" >Olia</span> <i class="fa fa-circle me"></i>
</div>
<div class="message other-message float-right">
Well I am not sure. The rest of the team is not here yet. Maybe in an hour or so? Have you faced any problems at the last phase of the project?
</div>
</li>
<li>
<div class="message-data">
<span class="message-data-name"><i class="fa fa-circle online"></i> Vincent</span>
<span class="message-data-time">10:20 AM, Today</span>
</div>
<div class="message my-message">
Actually everything was fine. I'm very excited to show this to our team.
</div>
</li>
<li>
<div class="message-data">
<span class="message-data-name"><i class="fa fa-circle online"></i> Vincent</span>
<span class="message-data-time">10:31 AM, Today</span>
</div>
<i class="fa fa-circle online"></i>
<i class="fa fa-circle online" style="color: #AED2A6"></i>
<i class="fa fa-circle online" style="color:#DAE9DA"></i>
</li>
</ul>
</div> <!-- end chat-history -->
<div class="chat-message clearfix">
<textarea name="message-to-send" id="message-to-send" placeholder ="Type your message" rows="3"></textarea>
<i class="fa fa-file-o"></i>
<i class="fa fa-file-image-o"></i>
<button>Send</button>
</div> <!-- end chat-message -->
</div> <!-- end chat -->
</div>
</div>
</div>
</body>
Please check snippet in full page for a better view
Replacing height: 100% with min-height: 100% in selector #chat-canvas will make your chat-canvas cover its child chat-field
* {
margin: 0;
padding: 0;
box-sizing: border-box !important;
}
html, body, #body {
background-color: #ffffff;
font-size: 15px;
color: #565656;
width: 100%;
padding: 0;
margin-left: 0;
margin-right: 0;
font-family: 'roboto', sans-serif;
font-weight: 300;
}
#body, .app html, body {
background-color: #f9f9f9;
font-size: 15px;
color: #565656;
width: 100%;
height: 100%;
padding: 0;
margin-left: 0;
margin-right: 0;
font-family: 'roboto', sans-serif;
font-weight: 300;
min-height: 100%;
}
html {
font-size: 10px;
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
transition: all 3s ease-in-out;
height: 100%;
min-height: 100%;
}
*,*:before,*:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#chat-canvas {
width: 94% !important;
min-height: 100%;
position: absolute;
float: left;
display: inline-block;
overflow: hidden;
}
.app-nav {
position: relative;
height: 100%;
width: 6%;
display: inline-block;
}
.tl-menu {
position: absolute;
overflow: hidden;
float: left;
top: 0;
height: 100%;
list-style-type: none;
margin: 0;
padding: 0;
background: #1b1e24;
z-index: 9999;
}
.tl-menu img{
max-height: 80%;
}
.tl-menu li a {
display: block;
height: 5em;
width: 5em;
line-height: 5em;
text-align: center;
color: #999;
position: relative;
border-bottom: 1px solid rgba(104,114,134,0.05);
-webkit-transition: background 0.1s ease-in-out;
-moz-transition: background 0.1s ease-in-out;
transition: background 0.1s ease-in-out;
}
.tl-menu li a:hover,
.tl-menu li:first-child a{
color: #55fec6;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
}
.tl-menu li a:active {
background: #afdefa;
color: #FFF;}
/* class for current item */
.tl-menu li.tl-current a {
background: #343a47;
color: #bbe6fe;
}
.tl-menu li a:before {
font-family: 'entypo', sans-serif;
speak: none;
font-style: normal;
font-weight: normal;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
font-size: 1.4em;
-webkit-font-smoothing: antialiased;
}
.tl-menu li a.icon-logo:before {
font-weight: 700;
font-size: 300%;
}
/* ---------- CHAT ---------- */
.people-list {
width: 30%;
float: right;
}
.people-list .search {
padding: 20px;
}
.people-list input {
border-radius: 3px;
border: none;
padding: 14px;
color: white;
background: #6A6C75;
width: 90%;
font-size: 14px;
}
.people-list .fa-search {
position: relative;
left: -25px;
}
.people-list ul {
padding: 20px;
height: 770px;
}
.people-list ul li {
padding-bottom: 20px;
}
.people-list img {
float: left;
}
.people-list .about {
float: left;
margin-top: 8px;
}
.people-list .about {
padding-left: 8px;
}
.people-list .status {
color: #92959E;
}
.chat {
width: 70%;
float: left;
position: absolute;
background: #F2F5F8;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
color: #434651;
}
.chat .chat-header {
padding: 20px;
border-bottom: 2px solid white;
}
.chat .chat-header img {
float: left;
}
.chat .chat-header .chat-about {
float: left;
padding-left: 10px;
margin-top: 6px;
}
.chat .chat-header .chat-with {
font-weight: bold;
font-size: 16px;
}
.chat .chat-header .chat-num-messages {
color: #92959E;
}
.chat .chat-header .fa-star {
float: right;
color: #D8DADF;
font-size: 20px;
margin-top: 12px;
}
.chat .chat-history {
padding: 30px 30px 20px;
border-bottom: 2px solid white;
overflow-y: scroll;
height: 575px;
}
.chat .chat-history .message-data {
margin-bottom: 15px;
}
.chat .chat-history .message-data-time {
color: #a8aab1;
padding-left: 6px;
}
.chat .chat-history .message {
color: white;
padding: 18px 20px;
line-height: 26px;
font-size: 16px;
border-radius: 7px;
margin-bottom: 30px;
width: 90%;
position: relative;
}
.chat .chat-history .message:after {
bottom: 100%;
left: 7%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
border-bottom-color: #86BB71;
border-width: 10px;
margin-left: -10px;
}
.chat .chat-history .my-message {
background: #86BB71;
}
.chat .chat-history .other-message {
background: #94C2ED;
}
.chat .chat-history .other-message:after {
border-bottom-color: #94C2ED;
left: 93%;
}
.chat .chat-message {
padding: 30px;
}
.chat .chat-message textarea {
width: 100%;
border: none;
padding: 10px 20px;
font: 14px/22px "Lato", Arial, sans-serif;
margin-bottom: 10px;
border-radius: 5px;
resize: none;
}
.chat .chat-message .fa-file-o, .chat .chat-message .fa-file-image-o {
font-size: 16px;
color: gray;
cursor: pointer;
}
.chat .chat-message button {
float: right;
color: #94C2ED;
font-size: 16px;
text-transform: uppercase;
border: none;
cursor: pointer;
font-weight: bold;
background: #F2F5F8;
}
.chat .chat-message button:hover {
color: #75b1e8;
}
.online, .offline, .me {
margin-right: 3px;
font-size: 10px;
}
.online {
color: #86BB71;
}
.offline {
color: #E38968;
}
.me {
color: #94C2ED;
}
.align-left {
text-align: left;
}
.align-right {
text-align: right;
}
.float-right {
float: right;
}
.clearfix:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
.chat-container {
bottom: 0;
left: 0;
right: 0;
height: auto;
margin: 0 auto;
width: 750px;
background: #444753;
border-radius: 5px;
}
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/>
<body class="app">
<!-- NAV -->
<div class="app-nav">
<ul class="tl-menu">
<li><img src="https://i.imgur.com/ngO5Ohx.png" alt="Mendr Logo" height="50" width="50"></li>
<li><img src="{{user.picture}}"></li>
<li><i class="fa fa-plus" style="font-size:30px; margin-top:20px;"></i></li>
<li><i class="fa fa-wechat" style="font-size:30px; margin-top:20px;"></i></li>
<li><i class="fa fa-map" style="font-size:30px; margin-top:20px;"></i></li>
<li><i class="fa fa-search" style="font-size:30px; margin-top:20px;"></i></li>
<li><i class="fa fa-sign-out" style="font-size:30px; margin-top:20px;"></i></li>
</ul>
</div>
<!-- END NAV -->
<!-- CHAT -->
<div id="chat-canvas">
<div class="clearfix chat-container">
<div class="people-list" id="people-list">
<div class="search">
<input type="text" placeholder="search" />
<i class="fa fa-search"></i>
</div>
<ul class="list">
<li class="clearfix">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/chat_avatar_01.jpg" alt="avatar" />
<div class="about">
<div class="name">Vincent Porter</div>
<div class="status">
<i class="fa fa-circle online"></i> online
</div>
</div>
</li>
<li class="clearfix">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/chat_avatar_02.jpg" alt="avatar" />
<div class="about">
<div class="name">Aiden Chavez</div>
<div class="status">
<i class="fa fa-circle offline"></i> left 7 mins ago
</div>
</div>
</li>
<li class="clearfix">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/chat_avatar_03.jpg" alt="avatar" />
<div class="about">
<div class="name">Mike Thomas</div>
<div class="status">
<i class="fa fa-circle online"></i> online
</div>
</div>
</li>
<li class="clearfix">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/chat_avatar_04.jpg" alt="avatar" />
<div class="about">
<div class="name">Erica Hughes</div>
<div class="status">
<i class="fa fa-circle online"></i> online
</div>
</div>
</li>
<li class="clearfix">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/chat_avatar_05.jpg" alt="avatar" />
<div class="about">
<div class="name">Ginger Johnston</div>
<div class="status">
<i class="fa fa-circle online"></i> online
</div>
</div>
</li>
<li class="clearfix">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/chat_avatar_06.jpg" alt="avatar" />
<div class="about">
<div class="name">Tracy Carpenter</div>
<div class="status">
<i class="fa fa-circle offline"></i> left 30 mins ago
</div>
</div>
</li>
<li class="clearfix">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/chat_avatar_07.jpg" alt="avatar" />
<div class="about">
<div class="name">Christian Kelly</div>
<div class="status">
<i class="fa fa-circle offline"></i> left 10 hours ago
</div>
</div>
</li>
<li class="clearfix">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/chat_avatar_08.jpg" alt="avatar" />
<div class="about">
<div class="name">Monica Ward</div>
<div class="status">
<i class="fa fa-circle online"></i> online
</div>
</div>
</li>
<li class="clearfix">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/chat_avatar_09.jpg" alt="avatar" />
<div class="about">
<div class="name">Dean Henry</div>
<div class="status">
<i class="fa fa-circle offline"></i> offline since Oct 28
</div>
</div>
</li>
<li class="clearfix">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/chat_avatar_10.jpg" alt="avatar" />
<div class="about">
<div class="name">Peyton Mckinney</div>
<div class="status">
<i class="fa fa-circle online"></i> online
</div>
</div>
</li>
</ul>
</div>
<div class="activity-info">
<div class="chat">
<div class="chat-header clearfix">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/chat_avatar_01_green.jpg" alt="avatar" />
<div class="chat-about">
<div class="chat-with">Chat with Vincent Porter</div>
<div class="chat-num-messages">already 1 902 messages</div>
</div>
<i class="fa fa-star"></i>
</div> <!-- end chat-header -->
<div class="chat-history">
<ul>
<li class="clearfix">
<div class="message-data align-right">
<span class="message-data-time" >10:10 AM, Today</span>
<span class="message-data-name" >Olia</span> <i class="fa fa-circle me"></i>
</div>
<div class="message other-message float-right">
Hi Vincent, how are you? How is the project coming along?
</div>
</li>
<li>
<div class="message-data">
<span class="message-data-name"><i class="fa fa-circle online"></i> Vincent</span>
<span class="message-data-time">10:12 AM, Today</span>
</div>
<div class="message my-message">
Are we meeting today? Project has been already finished and I have results to show you.
</div>
</li>
<li class="clearfix">
<div class="message-data align-right">
<span class="message-data-time" >10:14 AM, Today</span>
<span class="message-data-name" >Olia</span> <i class="fa fa-circle me"></i>
</div>
<div class="message other-message float-right">
Well I am not sure. The rest of the team is not here yet. Maybe in an hour or so? Have you faced any problems at the last phase of the project?
</div>
</li>
<li>
<div class="message-data">
<span class="message-data-name"><i class="fa fa-circle online"></i> Vincent</span>
<span class="message-data-time">10:20 AM, Today</span>
</div>
<div class="message my-message">
Actually everything was fine. I'm very excited to show this to our team.
</div>
</li>
<li>
<div class="message-data">
<span class="message-data-name"><i class="fa fa-circle online"></i> Vincent</span>
<span class="message-data-time">10:31 AM, Today</span>
</div>
<i class="fa fa-circle online"></i>
<i class="fa fa-circle online" style="color: #AED2A6"></i>
<i class="fa fa-circle online" style="color:#DAE9DA"></i>
</li>
</ul>
</div> <!-- end chat-history -->
<div class="chat-message clearfix">
<textarea name="message-to-send" id="message-to-send" placeholder ="Type your message" rows="3"></textarea>
<i class="fa fa-file-o"></i>
<i class="fa fa-file-image-o"></i>
<button>Send</button>
</div> <!-- end chat-message -->
</div> <!-- end chat -->
</div>
</div>
</div>
</body>
You should use calc(%100 - 200px); as a value to the width. Look up calc CSS it will work because I had the same problem.
Here you go: https://www.w3schools.com/cssref/func_calc.asp
I tried to solve your problem. please check https://jsfiddle.net/komal10041992/v5k1Lhgf/4/. I removed overflow property, gave height:auto and width: 100%

hide border-top in center of div

Here is what I am trying to achieve
This is in my div's open state so normally you do not see any filters but instead just a full circle. What I am having trouble with is I dont know how to prevent a border on a small section.
Here is what I have below as well as a Codepen
.bold {
font-weight: bold;
}
.bp-purple {
color: #9696ff;
}
.bp-nyan {
color: #67cfd6;
}
.bp-pink {
color: #e49092;
}
.bp-green {
color: #96cf6b;
}
.filter-options {
text-align: center;
margin: 15px 0 0 0;
}
.filter-options__intro {
text-transform: uppercase;
display: inline-block;
border: 1px solid #222;
border-radius: 50%;
height: 80px;
width: 80px;
padding: 30px 0;
color: #222;
}
.filter-options__intro i {
margin: -5px 0 0 0;
display: block;
}
.filter-options__intro:hover {
color: #f93;
}
.filter-options__selections {
border: 1px solid #222;
position: relative;
bottom: 30px;
background: #FFF;
text-align: left;
padding: 15px;
margin: 0 0 -25px 0;
}
.filter-options__selections .list-inline, .filter-options__selections .checkbox {
font-weight: bold;
text-transform: uppercase;
}
.filter-options__selections input {
margin: 0;
}
.filter-options__selections .first {
font-size: 1.2em;
}
.filter-options__selections .dotted-line {
margin: 0 0 10px 0;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="filter-options">
<a href="" class="filter-options__intro">
<b class="center-block">Filters</b>
<i class="fa fa-caret-down" aria-hidden="true"></i>
</a>
<div class="filter-options__selections clearfix">
<div class="clearfix">
<ul class="list-inline pull-left">
<li class="first bp-purple">Categories:</li>
<li>Category 1</li>
<li>Category 2</li>
<li>Category 3</li>
<li>Category 4</li>
</ul>
<a class="pull-right bold" href="">View All <i class="fa fa-caret-right" aria-hidden="true"></i></a>
</div>
<div class="dotted-line"></div>
<div class="clearfix">
<ul class="list-inline pull-left">
<li class="first bp-nyan">Location:</li>
<li>Shanghai</li>
<li>Beijing</li>
<li>Hangzhou</li>
<li>Chengdu</li>
<li>Guangzhou</li>
<li>Shenzhen</li>
<li>Suzhou</li>
<li>Nanjing</li>
</ul>
<a class="pull-right bold" href="">View All <i class="fa fa-caret-right" aria-hidden="true"></i></a>
</div>
<div class="dotted-line"></div>
<div class="clearfix">
<ul class="list-inline pull-left">
<li class="first bp-pink">Brand:</li>
<li>Belle</li>
<li>St&Sat</li>
<li>Charles & Keith</li>
<li>Aldo</li>
<li>Daphne</li>
<li>Zara</li>
<li>Camel</li>
<li>Le Saunda</li>
<li>Tata</li>
</ul>
<a class="pull-right bold" href="">View All <i class="fa fa-caret-right" aria-hidden="true"></i></a>
</div>
<div class="dotted-line"></div>
<div class="clearfix">
<ul class="list-inline pull-left">
<li class="first bp-green">Price Range:</li>
<li>100 - 200</li>
<li>200 - 500</li>
<li>500 - 1000</li>
<li>1000 - 3000</li>
</ul>
</div>
<div class="dotted-line"></div>
<div class="checkbox">
<label>
<input type="checkbox" /> Show only free shipping products
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" /> Do not show international products
</label>
</div>
<div class="dotted-line"></div>
</div>
</div>
</div>
Edit
Added sass tag as my codepen is in sass but not sure if stack lets me use it in snippets
First you need to make <a> position relatively.
.filter-options__intro {
position: relative;
}
Then add an css after selector, to cover up the black line
a.filter-options__intro:after {
content: '';
display: block;
background: white;
z-index: 1111;
position: absolute;
width: 75px;
height: 1px;
bottom: 0px;
left: 0;
right: 0;
margin: auto;
top: 20px;
}
Working example:
Overlap element using CSS :after
Tried something that might help you:
Position the whole DOM of the link relative.
I had to use three DOM Elements to make it look like your output.
Positioned the content at z-index: 1.
Positioned others in higher z-index.
Gave a faux background.
* {
margin: 0;
padding: 0;
list-style: none;
line-height: 1;
text-decoration: none;
}
body {
background-color: #fff;
}
.center {
text-align: center;
position: relative;
z-index: 5;
}
.faux-cutter {
text-align: center;
display: inline-block;
overflow: hidden;
height: 30px;
border-bottom: 1px solid #fff;
position: relative;
z-index: 3;
background-color: #fff;
bottom: -2px;
}
.border {
padding: 10px 20px 30px;
display: inline-block;
border: 1px solid #666;
border-radius: 100%;
position: relative;
z-index: 4;
}
.content {
border: 1px solid #666;
padding: 25px;
text-align: center;
top: -2px;
position: relative;
z-index: 1;
}
<div class="center">
<div class="faux-cutter">
Hi
</div>
</div>
<div class="content">
Content here.
</div>
Preview
I would layer the semi-circle over the rectangle, and then I would add an inner absolutely positioned div to hide the bottom of the filters circle. You could do something like this:
.bold {
font-weight: bold;
}
.bp-purple {
color: #9696ff;
}
.bp-nyan {
color: #67cfd6;
}
.bp-pink {
color: #e49092;
}
.bp-green {
color: #96cf6b;
}
.filter-options {
text-align: center;
margin: 15px 0 0 0;
}
.filter-options__intro {
text-transform: uppercase;
display: inline-block;
border: 1px solid #222;
border-radius: 50%;
height: 80px;
width: 80px;
background: white;
padding: 30px 0;
margin-bottom: -25px;
color: #222;
}
.filter-options__intro i {
margin: -5px 0 0 0;
display: block;
}
.filter-options__intro:hover {
color: #f93;
}
.filter-options__selections {
border-top: 1px solid #222;
background: #FFF;
text-align: left;
}
.filter-options__selections-inner {
position:absolute;
border-left: 1px solid black;
border-right: 1px solid black;
border-bottom: 1px solid black;
left: 15px;
right: 15px;
background: white;
padding: 15px;
}
.filter-options__selections .list-inline,
.filter-options__selections .checkbox {
font-weight: bold;
text-transform: uppercase;
}
.filter-options__selections input {
margin: 0;
}
.filter-options__selections .first {
font-size: 1.2em;
}
.filter-options__selections .dotted-line {
margin: 0 0 10px 0;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="filter-options">
<a href="" class="filter-options__intro">
<b class="center-block">Filters</b>
<i class="fa fa-caret-down" aria-hidden="true"></i>
</a>
<div class="filter-options__selections clearfix">
<div class="filter-options__selections-inner">
<div class="clearfix">
<ul class="list-inline pull-left">
<li class="first bp-purple">Categories:</li>
<li>Category 1</li>
<li>Category 2</li>
<li>Category 3</li>
<li>Category 4</li>
</ul>
<a class="pull-right bold" href="">View All <i class="fa fa-caret-right" aria-hidden="true"></i></a>
</div>
<div class="dotted-line"></div>
<div class="clearfix">
<ul class="list-inline pull-left">
<li class="first bp-nyan">Location:</li>
<li>Shanghai</li>
<li>Beijing</li>
<li>Hangzhou</li>
<li>Chengdu</li>
<li>Guangzhou</li>
<li>Shenzhen</li>
<li>Suzhou</li>
<li>Nanjing</li>
</ul>
<a class="pull-right bold" href="">View All <i class="fa fa-caret-right" aria-hidden="true"></i></a>
</div>
<div class="dotted-line"></div>
<div class="clearfix">
<ul class="list-inline pull-left">
<li class="first bp-pink">Brand:</li>
<li>Belle</li>
<li>St&Sat</li>
<li>Charles & Keith</li>
<li>Aldo</li>
<li>Daphne</li>
<li>Zara</li>
<li>Camel</li>
<li>Le Saunda</li>
<li>Tata</li>
</ul>
<a class="pull-right bold" href="">View All <i class="fa fa-caret-right" aria-hidden="true"></i></a>
</div>
<div class="dotted-line"></div>
<div class="clearfix">
<ul class="list-inline pull-left">
<li class="first bp-green">Price Range:</li>
<li>100 - 200</li>
<li>200 - 500</li>
<li>500 - 1000</li>
<li>1000 - 3000</li>
</ul>
</div>
<div class="dotted-line"></div>
<div class="checkbox">
<label>
<input type="checkbox" />Show only free shipping products
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" />Do not show international products
</label>
</div>
<div class="dotted-line"></div>
</div>
</div>
</div>
</div>
You can't disable a portion of the border. I'd suggest adding a span to mask that particular part of the border with a small rectangular shape and z-index. Here is a forked pen with my changes.
I added a span with the class of 'mask' directly within your .filter-options div. <span class="mask"></span>.
Adding some CSS allowed me to build the shape of the mask using a solid white block. It will work as long as the background color remains white.
.mask {
background-color: white;
position: relative;
top: 4px;
z-index: 2;
width: 77px;
height: 3px;
display: block;
}