I have create a table listing. When user hover the first cell that is with 3 dots Edit and Delete option are displayed and below that there is a transparent background.
Everything is fine when content is in single line.
Issue is when there is more content. The height of overlay does not adjust. I have tried top: 0; bottom: 0; height: 100% to the .action it covers the whole table.
body {
margin: 0
}
.table {
display: table;
width: 100%;
border-bottom: 1px solid #ccc
}
.tHead,
.tRow {
display: table-row;
position: relative;
}
.tCell {
display: table-cell;
padding: 5px;
background: #fff;
border-top: 1px solid #ccc;
}
.tHead .tCell {
background: #ccc;
}
.tRow:hover .tCell {
background: #f4f4f4;
border-color: #000;
}
.tRow:hover + .tRow .tCell {
border-color: #000;
}
.tRow .tCell:first-child {
width: 10px;
cursor: pointer;
opacity: 1
}
.menu {
display: block;
height: 3px;
width: 3px;
background: #ccc;
position: relative;
margin-left: 5px;
top: 3px;
z-index: 2;
}
.menu:before,
.menu:after {
display: block;
height: 3px;
width: 3px;
background: #ccc;
position: absolute;
content: " ";
top: -6px;
}
.menu:before {
top: -12px;
}
.actions {
display: none;
position: absolute;
white-space: nowrap;
z-index: 1;
left: 0;
right: 0;
margin-top: -19px;
background: rgba(255, 255, 255, 0.9);
padding: 5px 5px 5px 28px;
}
.tCell:hover .menu:before,
.tCell:hover .menu:after,
.tCell:hover .menu {
background: #000
}
.tCell:hover .actions {
display: block
}
<div class="table">
<div class="tHead">
<div class="tCell"></div>
<div class="tCell">Name</div>
<div class="tCell">Age</div>
<div class="tCell">Gender</div>
<div class="tCell">Job Profile</div>
</div>
<div class="tRow">
<div class="tCell"><span class="menu"></span><span class="actions">
Edit |
Delete
</span>
</div>
<div class="tCell">Kelly</div>
<div class="tCell">28</div>
<div class="tCell">Female</div>
<div class="tCell">Web Developer</div>
</div>
<div class="tRow hovered">
<div class="tCell"><span class="menu"></span>
<span class="actions">
Edit |
Delete
</span>
</div>
<div class="tCell">Jack
</div>
<div class="tCell">32</div>
<div class="tCell">Male</div>
<div class="tCell">Java Developer</div>
</div>
<div class="tRow">
<div class="tCell"><span class="menu"></span><span class="actions">
Edit |
Delete
</span>
</div>
<div class="tCell">
Janaya
</div>
<div class="tCell">26</div>
<div class="tCell">Female</div>
<div class="tCell">.Net Developer</div>
</div>
<div class="tRow ">
<div class="tCell"><span class="menu"></span><span class="actions">
Edit |
Delete
</span>
</div>
<div class="tCell">Jim</div>
<div class="tCell">24</div>
<div class="tCell">Male</div>
<div class="tCell">Full Stack Developer</div>
</div>
</div>
Hope this helps you.
Use :before for the overlay on the cell and target the cells using ~ operator. I had same requirement. This is how I handled it.
body {
margin: 0
}
.table {
display: table;
width: 100%;
}
.tHead,
.tRow {
display: table-row;
position: relative;
}
.tCell {
display: table-cell;
padding: 5px;
background: #fff;
border-top: 1px solid #ccc;
position: relative
}
.tRow:last-child .tCell {
border-bottom: 1px solid #ccc;
}
.tHead .tCell {
background: #ccc;
}
.tRow:hover .tCell {
background: #f4f4f4;
border-color: #000;
}
.tRow .tCell:before {
content: "";
position: absolute;
height: 100%;
width: 100%;
background: rgba(255, 255, 255, 0.9);
top: 0;
left: 0;
display: none;
}
.tRow:hover + .tRow .tCell {
border-color: #000;
}
.tRow .tCell:first-child {
width: 10px;
cursor: pointer;
opacity: 1
}
.menu {
display: block;
height: 3px;
width: 3px;
background: #ccc;
position: relative;
margin-left: 5px;
top: 3px;
z-index: 3;
}
.menu:before,
.menu:after {
display: block;
height: 3px;
width: 3px;
background: #ccc;
position: absolute;
content: " ";
top: -6px;
}
.menu:before {
top: -12px;
}
.actions {
display: none;
position: absolute;
white-space: nowrap;
z-index: 4;
left: 0;
right: 0;
margin-top: -19px;
padding: 5px 5px 5px 28px;
}
.tCell:hover .menu:before,
.tCell:hover .menu:after,
.tCell:hover .menu {
background: #000
}
.tCell:hover .actions {
display: block
}
.tRow:hover .tCell:first-child:hover:before,
.tRow:hover .tCell:first-child:hover ~ .tCell:before {
display: block;
}
<div class="table">
<div class="tHead">
<div class="tCell"></div>
<div class="tCell">Name</div>
<div class="tCell">Age</div>
<div class="tCell">Gender</div>
<div class="tCell">Job Profile</div>
</div>
<div class="tRow">
<div class="tCell"><span class="menu"></span><span class="actions">
Edit |
Delete
</span>
</div>
<div class="tCell">Kelly</div>
<div class="tCell">28</div>
<div class="tCell">Female</div>
<div class="tCell">Web Developer</div>
</div>
<div class="tRow hovered">
<div class="tCell"><span class="menu"></span>
<span class="actions">
Edit |
Delete
</span>
</div>
<div class="tCell">Jack
</div>
<div class="tCell">32</div>
<div class="tCell">Male</div>
<div class="tCell">Java Developer</div>
</div>
<div class="tRow">
<div class="tCell"><span class="menu"></span><span class="actions">
Edit |
Delete
</span>
</div>
<div class="tCell">
Janaya
</div>
<div class="tCell">26</div>
<div class="tCell">Female</div>
<div class="tCell">.Net Developer</div>
</div>
<div class="tRow ">
<div class="tCell"><span class="menu"></span><span class="actions">
Edit |
Delete
</span>
</div>
<div class="tCell">Jim</div>
<div class="tCell">24</div>
<div class="tCell">Male</div>
<div class="tCell">Full Stack Developer</div>
</div>
</div>
#Tushar .. I noticed that the bottom line of the table, the div border never gets updated on the hover.. fiddle example
.tCell:hover .menu:before,
.tCell:hover .menu:after,
.tCell:hover .menu {
background: #000;
}
Related
this is what I want to do
and here is my css and a screenshot what this does:
.bread-list>.bread-item {
background: #B7B7B7;
font-size: 20px;
color: #FFFFFF;
padding: 20px;
margin-top: 2px;
}
.bread-item::after {
content: '';
position: absolute;
left: 42%;
top: 100%;
width: 0;
height: 0;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
border-top: 20px solid #B7B7B7;
clear: both;
}
<div class="bread-list">
<div class="bread-item col-lg-12">
Clients
<div class="result-counter">
182 Total
</div>
<div class="brand-name">
Teva
</div>
</div>
<div class="bread-item col-lg-12">
Sections
<div class="result-counter">
4 Total
</div>
<div class="brand-name">
Teva UK
</div>
</div>
<div class="bread-item col-lg-12">
Projects
<div class="result-counter">
4 Total
</div>
<div class="brand-name">
Project 3
</div>
</div>
</div>
here is what my actual code shows to me
where I'm wrong exactly?
edit: I've added html-side with all relevant codes. I would like to do differently this for also first and last element.
try this
.bread-list>.bread-item {
background: #B7B7B7;
font-size: 20px;
color: #FFFFFF;
padding: 20px;
margin-top: 2px;
position: relative;
}
.bread-item::after {
content: '';
position: absolute;
left: 50%;
background: #B7B7B7;
width: 20px;
height: 20px;
border: solid #FFFFFF;
border-width: 0 2px 2px 0;
display: inline-block;
padding: 3px;
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
clear: both;
bottom: -16px;
z-index: 1;
}
Try this..
.bread-list>.bread-item {
background: #B7B7B7;
font-size: 20px;
color: #FFFFFF;
padding: 20px;
margin-top: 2px;
position: relative;
}
.bread-item::after {
content: '';
position: absolute;
left: 42%;
top: -9px;
width: 15px;
height: 15px;
border-right: 2px solid;
border-bottom: 2px solid;
clear: both;
transform: rotate(45deg);
background: #B7B7B7;
}
.bread-item:first-child::after{
display:none;
}
<div class="bread-list">
<div class="bread-item col-lg-12">
Clients
<div class="result-counter">
182 Total
</div>
<div class="brand-name">
Teva
</div>
</div>
<div class="bread-item col-lg-12">
Sections
<div class="result-counter">
4 Total
</div>
<div class="brand-name">
Teva UK
</div>
</div>
<div class="bread-item col-lg-12">
Projects
<div class="result-counter">
4 Total
</div>
<div class="brand-name">
Project 3
</div>
</div>
</div>
try add the following to .bread-list > .bread-item
position: relative;
I have a mega menu which is vertically above a div that contains image banners. When hovering over this mega menu it expands displaying content. When expanding the content goes under the images in the image banner div making them not visible. I want it to be on top of the image banner div when I hover over mega menu links.
* {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding: 0; margin: 0;
}
body {
}
.wrapperss {
font-size: 1.6em;
padding: 2em;
margin: 0 auto;
width: 95%;
background-color: white;
z-index: 999;
}
/* Navigation Bar Styling */
.navSuper {
background: white;
width: 100%;
height: 43px;
position: relative;
border: 1px solid #B2BEB5;
}
.navSuper li {
list-style: none;
float: left;
text-align: center;
width: 33%;
width: calc(100% / 3);
}
.navSuper > li > a {
color: #536267;
font-weight: bold;
font-size: .7em;
text-decoration: none;
line-height: 43px;
padding: 0 20px;
height: 43px;
text-transform: uppercase;
}
.navSuper > li:hover {
border-right: 1px solid #b2beb5;
border-left: 1px solid #b2beb5;
}
.navSuper > li:hover > div {
display: block;
}
.navSuper > li > div {
position: absolute;
left: 0;
top: 41px;
display: none;
background-color: white;
padding: 10px 10px;
box-shadow: 2px 4px 4px rgba(0,0,0,0.4);
overflow: hidden;
}
.nav-mainCustom{
width: 100%;
border: 1px solid #b2beb5;
}
.nav-dividerCustom {
display: inline-block;
width: 1.8%;
}
.nav-focus-artCustom {
display: inline-block;
width: 11.5%;
vertical-align: top;
text-align: center;
}
.nav-art-authorCustom, .nav-art-titleCustom{
display: inline-block;
padding: 10px 0px;
}
.nav-art-authorCustom {
font-size: .9em;
color: red;
}
.nav-art-titleCustom {
font-size: 1.4em;
}
.nav-art-imageCustom {
display: inline-block;
}
.nav-divider-2Custom {
display:inline-block;
width: 3.8%;
}
.nav-headlinesCustom {
display:inline-block;
width: 34.5%;
font-size: 1.2em;
font-weight: bold;
text-align: left;
padding-right: 3px;
}
.nav-headline-linkCustom {
border-bottom: 1px solid #b2beb5;
padding: 10px 0px;
}
.nav-headline-linkCustom:last-child {
border-width: 0px;
}
.nav-linksCustom{
display: inline-block;
width: 11.95%;
vertical-align: top;
text-align: left;
}
.nav-linkCustom{
/*padding-bottom: 20px; */
}
.nav-empty-cellCustom{
}
.nav-headline-linkCustom:first-child{
color: red;
}
.nav-linkCustom:first-child{
color: red;
}
<div class="wrapperss">
<ul class="navSuper">
<li>Title 1
<div class="nav-mainCustom">
<div class="nav-divider"></div>
<div class="nav-focus-artCustom">
<img class="nav-art-imageCustom" src="http://example image" alt="article image"/>
<span class="nav-art-authorCustom">Title 2</span> <br>
<span class="nav-art-titleCustom">Product 1</span>
</div>
<div class="nav-divider-2Custom"></div>
<div class="nav-focus-artCustom">
<img class="nav-art-imageCustom" src="http://exampleimage" alt="article image"/>
<span class="nav-art-authorCustom">Title 3</span><br>
<span class="nav-art-titleCustom">Product 2</span>
</div>
<div class="nav-divider-2Custom"></div>
<div class="nav-headlinesCustom">
<div class="nav-headline-linkCustom">New Products</div>
<div class="nav-headline-linkCustom">Product 1 Desctiption</div>
<div class="nav-headline-linkCustom">Product 2 Desctiption</div>
<div class="nav-headline-linkCustom">Product 3 Desctiption</div>
<div class="nav-headline-linkCustom">Product 4 Desctiption</div>
<div class="nav-headline-linkCustom">Product 5 Desctiption</div>
</div>
<div class="nav-divider-2Custom"></div>
<div class="nav-linksCustom">
<div class="nav-linkCustom">Categories</div>
<div class="nav-linkCustom">CAt 1</div>
<div class="nav-linkCustom">Cat 2</div>
<div class="nav-linkCustom">Cat 3</div>
<div class="nav-linkCustom">Cat 4</div>
</div>
<div class="nav-linksCustom">
<div class="nav-empty-cellCustom"></div>
<div class="nav-linkCustom">Test 1</div>
<div class="nav-linkCustom">Cat 5</div>
<div class="nav-linkCustom">Cat 6</div>
<div class="nav-linkCustom">Cat 7</div>
<div class="nav-linkCustom">Cat 8</div>
</div>
In .navSuper class use
z-index: 99;
I really need your help with this. For the life of me, I cannot begin to understand as to why I cannot seem to get my form DIV to properly be positioned on the right side of my 2 column layout.
See attached picture below:
Here is the HTML & CSS in question:
* {
font-family: Segoe UI;
font-size: 9pt;
}
html, body {
padding: 0;
margin: 0;
}
body {
background: rgb(187,195,203);
}
.Absolute-Center {
margin: auto;
}
#wrapper {
position:absolute;
top:50%;
left:50%;
transform: translate(-50%,-50%);
}
#layout {
height: auto;
width: 900px;
border: 1px solid rgb(112,112,112);
}
#box1 {
background: rgb(141,155,169);
color: #FFF;
padding: 3px;
font-weight: bold;
}
#box2 {
width: 100%;
background: rgb(240,240,240);
border-bottom: 1px solid rgb(180,180,180);
padding: 4px;
box-sizing: border-box;
}
#box3 {
width: 100%;
border-bottom: 1px solid rgb(180,180,180);
}
#box4 {
background: #FFF;
float: left;
width: 175px;
height: 375px;
border-right: 1px solid rgb(180,180,180);
}
#box5 {
background: rgb(240,240,240);
height: 375px;
}
#box7 {
background: rgb(240,240,240);
padding: 5px;
text-align:center;
}
#leftcolumn {
float: left;
}
#rightcolumn {
border: 0;
padding: 3px;
text-align: center;
}
.clear {
clear: both;
}
fieldset {
margin: 0;
padding: 2px;
padding-bottom: 5px;
}
div.wrapper {
width: 500px;
}
div.form {
width: 100%;
background-color: rgb(240,240,240);
border: 1px sold #000;
padding: 5px;
}
div.row {
clear: both;
padding-top: 5px;
}
div.row span.label {
float: left;
width: 50px;
text-align: right;
padding-right: 5px;
}
div.row span.formw {
float: left;
width: 200px;
text-align: left;
}
div.spacer {
clear: both;
}
span.title {
color: rgb(70,141,180);
}
input {
width: 150px;
border: 1px solid #000;
}
<div id="wrapper">
<div id="layout" class="Absolute-Center">
<div id="box1">Application Title</div>
<div id="box2">
<div id="leftcolumn"></div>
<div id="rightcolumn"></div>
<div class="clear"></div>
</div>
<div id="box3">
<!-- LEFT WINDOW PANE -->
<div id="box4">
<div id="menu_wrapper">
<ul id="menu">
<li data-show="#1">File Information</li>
<li data-show="#2">Comments</li>
</ul>
</div>
</div>
<!-- RIGHT WINDOW PANE -->
<div id="box5">
<!-- CONTENT [TAB1] -->
<div id="1" style="width: 100%;" class="hidden tab">
<div class="form">
<form>
<div style="border-bottom: 1px solid #000;" class="row"><span class="title">FILE INFORMATION</span></div>
<div class="row">
<span><b>Date Received</b></span>
</div>
<div class="row">
<span class="label">From:</span><span class="formw"><input type="text"/></span>
</div>
<div class="row">
<span class="label">To:</span><span class="formw"><input type="text"/></span>
</div>
<div class="spacer"></div>
</form>
</div>
</div>
<!-- CONTENT [TAB2] -->
<div id="2" class="hidden tab"></div>
</div>
</div>
</div>
</div>
I got it to sit in the right container by adding float:right to the form container div
Fiddle - http://jsfiddle.net/90777hu9/
It's because you float box4 left but you do not float box5 right. So it is still in the flow of the document and pushed below the float left.
Added float:left and width: 78%; to .box5 Press in the snippet the fullpage button to see it
* {
font-family: Segoe UI;
font-size: 9pt;
}
html, body {
padding: 0;
margin: 0;
}
body {
background: rgb(187,195,203);
}
.Absolute-Center {
margin: auto;
}
#wrapper {
position:absolute;
top:50%;
left:50%;
transform: translate(-50%,-50%);
}
#layout {
height: auto;
width: 900px;
border: 1px solid rgb(112,112,112);
}
#box1 {
background: rgb(141,155,169);
color: #FFF;
padding: 3px;
font-weight: bold;
}
#box2 {
width: 100%;
background: rgb(240,240,240);
border-bottom: 1px solid rgb(180,180,180);
padding: 4px;
box-sizing: border-box;
}
#box3 {
width: 100%;
border-bottom: 1px solid rgb(180,180,180);
}
#box4 {
background: #FFF;
float: left;
width: 175px;
height: 375px;
border-right: 1px solid rgb(180,180,180);
}
#box5 {
background: rgb(240,240,240);
height: 375px;
float:left;
width: 78%;
}
#box7 {
background: rgb(240,240,240);
padding: 5px;
text-align:center;
}
#leftcolumn {
float: left;
}
#rightcolumn {
border: 0;
padding: 3px;
text-align: center;
}
.clear {
clear: both;
}
fieldset {
margin: 0;
padding: 2px;
padding-bottom: 5px;
}
div.wrapper {
width: 500px;
}
div.form {
width: 100%;
background-color: rgb(240,240,240);
border: 1px sold #000;
padding: 5px;
}
div.row {
clear: both;
padding-top: 5px;
}
div.row span.label {
float: left;
width: 50px;
text-align: right;
padding-right: 5px;
}
div.row span.formw {
float: left;
width: 200px;
text-align: left;
}
div.spacer {
clear: both;
}
span.title {
color: rgb(70,141,180);
}
input {
width: 150px;
border: 1px solid #000;
}
<div id="wrapper">
<div id="layout" class="Absolute-Center">
<div id="box1">Application Title</div>
<div id="box2">
<div id="leftcolumn"></div>
<div id="rightcolumn"></div>
<div class="clear"></div>
</div>
<div id="box3">
<!-- LEFT WINDOW PANE -->
<div id="box4">
<div id="menu_wrapper">
<ul id="menu">
<li data-show="#1">File Information</li>
<li data-show="#2">Comments</li>
</ul>
</div>
</div>
<!-- RIGHT WINDOW PANE -->
<div id="box5">
<!-- CONTENT [TAB1] -->
<div id="1" style="width: 100%;" class="hidden tab">
<div class="form">
<form>
<div style="border-bottom: 1px solid #000;" class="row"><span class="title">FILE INFORMATION</span></div>
<div class="row">
<span><b>Date Received</b></span>
</div>
<div class="row">
<span class="label">From:</span><span class="formw"><input type="text"/></span>
</div>
<div class="row">
<span class="label">To:</span><span class="formw"><input type="text"/></span>
</div>
<div class="spacer"></div>
</form>
</div>
</div>
<!-- CONTENT [TAB2] -->
<div id="2" class="hidden tab"></div>
</div>
</div>
</div>
</div>
I'm building the following (see image). Basically, I need 5 buttons with overlapping buttons (each with numbers) on the top. However, I'm unsure how to go about this?
One solution:
https://jsfiddle.net/ryd5e51n/
<div class="button">
<div class="button-top"><span class="text">1</span></div>
<div class="button-bottom"></div>
</div>
.button
{
display: table;
}
.button-top
{
background-color: black;
width: 36px;
height: 36px;
border-radius: 18px;
margin: auto;
position: relative;
z-index: 2;
box-shadow: 0px 0px 2px 2px #bbbbbb;
color: white;
text-align: center;
}
.text
{
display: block;
position: relative;
top: 50%;
transform: translateY(-50%);
}
.button-bottom
{
background-color: #efefef;
width: 100px;
height: 90px;
margin-top: -15px;
position: relative;
z-index: 1;
border: 2px solid #bbbbbb;
border-radius: 20px;
}
You can do this with a single element:
HTML:
<div class="button">
</div>
<div class="button">
</div>
<div class="button">
</div>
<div class="button">
</div>
<div class="button">
</div>
CSS:
div.button {
display:block;
float:left;
margin:18px 5px 0;
position:relative;
overflow:visible;
background:none #efefef;
width:100px;
height:100px;
border:2px solid #ccc;
border-radius:10px;
counter-increment: button;
}
div.button:before {
content:counter(button);
display:block;
padding:8px 14px;
background:none #000;
border:2px solid #ccc;
border-radius:100px;
color:#fff;
position:absolute;
left:50%;
top:-18px;
transform: translateX(-50%);
}
See fiddle: https://jsfiddle.net/jj2nk5f1/2/
Here it is.
.button {
float: left;
margin-left: 10px;
}
.number {
width: 20px;
height: 20px;
border-radius: 10px;
background-color: black;
margin-left: 15px;
}
.block {
width: 50px;
height: 50px;
border: 1px solid black;
margin-top: -10px;
}
<div class="button">
<div class="number"></div>
<div class="block"></div>
</div>
<div class="button">
<div class="number"></div>
<div class="block"></div>
</div>
<div class="button">
<div class="number"></div>
<div class="block"></div>
</div>
<div class="button">
<div class="number"></div>
<div class="block"></div>
</div>
<div class="button">
<div class="number"></div>
<div class="block"></div>
</div>
So I got a sketch of a designer I worked with and was wondering how I create the border arrows in the picture below
I tried to put out this font-awesome icon by using the :after selector, it got pretty ugly:
http://fortawesome.github.io/Font-Awesome/icon/angle-right/
So instead, I tried to put an arrow on an arrow through this arrow generator:
http://apps.eky.hk/css-triangle-generator/
It also became very ugly. So now I wonder if there is anyone who has a good idea on how to solve this?
How my html look like so far:
<div class="bx-pager bx-default-pager">
<div class="bx-pager-item">
<a class="bx-pager-link active" data-slide-index="0" href=""> 1. DIN EXPERT </a>
</div>
<div class="bx-pager-item">
<a class="bx-pager-link" data-slide-index="1" href=""> 2. VÅRA TJÄNSTER </a>
</div>
<div class="bx-pager-item">
<a class="bx-pager-link" data-slide-index="2" href=""> 3. CASE </a>
</div>
<div class="bx-pager-item">
<a class="bx-pager-link" data-slide-index="3" href=""> 4. KONTAKT </a>
</div>
</div>
You can create triangles with CSS borders by:
border-top: 20px solid transparent;
border-bottom: 20px solid transparent; /* 40px height (20+20) */
border-left: 20px solid green
I've created the same thing as you see above here:
#container {
width:150px;
height:40px;
background-color:green;
position:relative;
}
.arrow-right {
width: 0;
height: 0;
border-top: 20px solid transparent;
border-bottom: 20px solid transparent; /* 40px height (20+20) */
border-left: 20px solid green;
position:absolute;
right:-20px;
}
<div id="container">
<div class="arrow-right"></div>
</div>
Atlast!! :)
div.main {
margin-right:30px;
}
ol > li {
display: table-cell;
height: 30px;
position: relative;
padding: 0px;
margin: 0px;
text-align: center;
border: 1px solid #d68a3a;
}
ol > li > div {
position:relative;
line-height: 30px; /* equal to the list item's height */
height:100%;
width: 100%;
}
ol>li:hover {
background-color: #d68a3a;
cursor: pointer;
color: white;
}
ol {
display: table;
width: 100%;
padding: 0px;
margin: 0px;
position: relative;
}
ol > li > div:after, ol > li > div:before {
content:"";
display:inline-block;
border-width: 16px;
border-style: solid;
width: 0px;
height: 0px;
left: 100%;
top: -1px;
position: absolute;
z-index: 1;
}
ol > li > div:after, ol > li:hover > div:before {
border-color: transparent transparent transparent #d68a3a;
}
ol > li > div:before {
border-width: 14px;
display: block;
border-color: transparent transparent transparent #ffffff;
z-index: 2;
top:1px;
}
Working Fiddle
You have to make little bit changes to your html structure
Put active class at bx-pager-item element level
Put 1 extra element after anchor tag .
Please refer below code snippet.
Working fiddle link: Fiddle
.container {
max-width: 700px;
margin: auto;
}
.bx-pager {
display: flex;
align-items: center;
height: 34px;
border-left: 1px solid #d68a3a;
}
.bx-pager .bx-pager-item {
display: flex;
align-items: center;
height: 100%;
flex: 0 25%;
border-top: 1px solid #d68a3a;
border-bottom: 1px solid #d68a3a;
}
.bx-pager .bx-pager-item .bx-pager-link {
text-decoration: none;
color: #222;
font-size: 13px;
flex: 1;
padding-left: 16px;
text-align: center;
}
.bx-pager .bx-pager-item .arrow {
border: solid #d68a3a;
display: inline-block;
padding: 9px;
border-width: 0 1px 1px 0;
transform: translateY(15.5px) rotate(-45deg) skew(-15deg, -15deg) translateX(18px);
background-color: #FFF;
}
.bx-pager .bx-pager-item.active {
background-color: #d68a3a;
}
.bx-pager .bx-pager-item.active .bx-pager-link {
color: white;
}
.bx-pager .bx-pager-item.active .arrow {
background-color: #d68a3a;
}
<body>
<div class="container">
<div class="bx-pager bx-default-pager">
<div class="bx-pager-item active">
<a class="bx-pager-link " data-slide-index="0" href=""> 1. DIN EXPERT </a>
<div class="arrow">
</div>
</div>
<div class="bx-pager-item">
<a class="bx-pager-link" data-slide-index="1" href=""> 2. VÅRA TJÄNSTER </a>
<div class="arrow">
</div>
</div>
<div class="bx-pager-item">
<a class="bx-pager-link" data-slide-index="2" href=""> 3. CASE </a>
<div class="arrow">
</div>
</div>
<div class="bx-pager-item">
<a class="bx-pager-link" data-slide-index="3" href=""> 4. KONTAKT </a>
<div class="arrow">
</div>
</div>
</div>
</div>
</body>
Please Change according to your specification.
<style>
.menu {
position: relative;
background: #88b7d5;
width:150px;
height:60px;
}
.menu:after, .menu:before {
left: 100%;
top: 50%;
border: solid transparent;
content: " ";
height: 0px;
width: 0px;
position: absolute;
pointer-events: none;
}
.menu:after {
border-color: rgba(136, 183, 213, 0);
border-left-color: #88b7d5;
border-width: 30px;
margin-top: -30px;
}
</style>
<div class="menu">
</div>
In case it is needed for others here is another solution, that can work as the requested answer, but will work if there is a need of separation of the elements.
Using the above examples, what will happen is that the background must always remain the same color. Like this it will always have a separation thus transparency between items.
Hope this helps, this post really helped me to find this solution :)
.items--container {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: relative;
margin-left: 1rem;
width: 150px;
height: 50px;
}
.item.active .content {
color: #FFFFFF;
}
.item.active .arrow {
background: #d68a3a;
}
.content {
color: #000000;
position: absolute;
z-index: 2;
}
.arrow {
width: 100%;
height: 50%;
background: #FFFFFF;
}
.arrow.top {
transform: skew(45deg, 0deg);
border-left: 1px solid #d68a3a;
border-right: 1px solid #d68a3a;
border-top: 1px solid #d68a3a;
}
.arrow.bottom {
transform: skew(-45deg, 0deg);
border-left: 1px solid #d68a3a;
border-right: 1px solid #d68a3a;
border-bottom: 1px solid #d68a3a;
}
<div class="items--container">
<div class='item'>
<div class="arrow top"></div>
<div class="content">Menu Item 1</div>
<div class="arrow bottom"></div>
</div>
<div class='item'>
<div class="arrow top"></div>
<div class="content">Menu Item 2</div>
<div class="arrow bottom"></div>
</div>
<div class='item active'>
<div class="arrow top"></div>
<div class="content">Menu Item 3</div>
<div class="arrow bottom"></div>
</div>
<div class='item'>
<div class="arrow top"></div>
<div class="content">Menu Item 4</div>
<div class="arrow bottom"></div>
</div>
</div>