CSS make banner look like it comes from the background - css

I'm trying to make it look like in the image.
This is what i have done so far:
But i cant figure out how to do the line so that it looks like the banner comes from behind the line.
My markup for the banner is this:
<div class="step-arrows">
<div class="top-line"></div>
<div class="box">
<div>1</div>
</div>
<div class="arrow"></div>
<div class="top-line"></div>
<div class="box">
<div>2</div>
</div>
<div class="arrow"></div>
<div class="top-line"></div>
<div class="box">
<div>3</div>
</div>
<div class="arrow"></div>
</div>
and this is the styles i have done so far:
.step-arrows {
margin-left: 20%;
}
.step-arrows .box {
background-color: #2E8074;
width: 100px;
height: 100px;
color: white;
text-align: center;
}
.step-arrows .box > div {
font-size: 80px;
}
.step-arrows .arrow {
width: 0px;
height: 0px;
border-top: 50px solid #2E8074;
border-left: 50.5px solid transparent;
border-right: 50.5px solid transparent;
margin-top: -1px;
}
I have tried to do it with box-shadow but i haven't been able to make it look very good :(
EDIT: (My last try)
.step-arrows .top-line {
width: 150px;
height: 2px;
margin-left: -25px;
z-index: 99;
position: absolute;
border-radius: 20px;
background-color: rgb(0, 0, 0);
-webkit-box-shadow: 0px 67px 12px 15px rgba(0,0,0,0.68);
-moz-box-shadow: 0px 67px 12px 15px rgba(0,0,0,0.68);
box-shadow: 0px 3px 9px 4px rgb(0, 0, 0);*/
}

Related

Folder-like menu css

I'm working with a table-like menu but I can't do it. Here is my CSS.
I'm using bootstrap 5. I can't adjust the padding and also the color of the menu when it's active or not.
.top-nav{
margin-left:0px;
}
.top-bar a {
display: block;
text-align: center;
padding: 20px;
text-decoration: none;
}
.top-bar{
border-bottom: 100px solid white;
border-left: 0 solid transparent;
border-right: 80px solid transparent;
border-top: 80px;
height: 0;
width: 200px;
clip-path: inset(0% 0% 0% 0% round 15px 0px 0px 0px)
}
Here is my HTML
<div class="row top-nav">
<div class="col-md-3 top-bar">
<a class="fw-bold text-primary" href="#home">Users</a>
</div>
<div class="col-md-3 top-bar">
<a class="fw-bold text-primary" href="#home">Warehouse Admin</a>
</div>
<div class="col-md-3 top-bar">
<a class="fw-bold text-primary" href="#home">Sales Rep</a>
</div>
<div class="col-md-3 top-bar">
<a class="fw-bold text-primary" href="#home">Senior Sales Rep</a>
</div>
</div>
My work
This the expected Output
run the snippet and change variables as you like
.folders {
background: lightgray;
padding: 10px;
}
.tabs:after {
content: "";
clear: both;
display: block;
}
.tab {
height: 40px;
line-height: 40px;
width: 150px;
float: left;
background: gray;
border-top-left-radius: 16px 16px;
border-top-right-radius: 16px 16px;
position: relative;
margin-right: 17.5px;
}
.tab.active {
z-index: 100;
background: #fff;
}
.tab:after {
content: "";
display: block;
position: absolute;
border-left: 35px solid gray;
left: 145px;
border-top: 35px solid transparent;
bottom: 0;
}
.tab.active:after {
border-left: 35px solid #fff;
}
.content {
height: 200px;
background: #fff;
}
<div class="folders">
<div class="tabs">
<div class="tab"></div>
<div class="tab active"></div>
<div class="tab"></div>
<div class="tab"></div>
</div>
<div class="contents">
<div class="content"></div>
</div>
</div>

Process flow css arrows

I'm trying to get some process flow arrow div's working. The idea is on the current process you would select someone to assign it to from a dropdown inside that current process and click a button to tell that person. That person will come in and on that process they'll see Accept or Reject buttons and then I'll open up the next process with a dropdown on who to assign again.
I'm having trouble just being able to get stuff to fit inside the process div. Things get all whacky. Ideally because they have "arrows" each process div would be a specific height that I set so it can handle the biggest height requirements inside (when buttons or dropdowns are inside).
I'm also not a huge fan of having to increase the left value by 30 pixels for each div arrow element. Any way to get this same look and feel without having to do that?
.arrow-container > div {
float: left;
}
.arrow-left-done {
display: inline-block;
width: 0;
height: 0;
border-top: 40px solid #d8ffcc;
border-bottom: 40px solid #d8ffcc;
border-left: 40px solid transparent;
}
.arrow-ctr-done {
display: inline-block;
width: 150px;
background: #d8ffcc;
min-height: 80px;
line-height: 80px;
position: relative;
text-align: center;
}
.arrow-right-done {
display: inline-block;
height: 0;
border-top: 40px solid transparent;
border-bottom: 40px solid transparent;
border-left: 40px solid #d8ffcc;
position: relative;
}
.arrow-left-current {
display: inline-block;
width: 0;
height: 0;
border-top: 40px solid #99afff;
border-bottom: 40px solid #99afff;
border-left: 40px solid transparent;
}
.arrow-ctr-current {
display: inline-block;
width: 150px;
background: #99afff;
min-height: 80px;
line-height: 80px;
position: relative;
text-align: center;
}
.arrow-right-current {
display: inline-block;
height: 0;
border-top: 40px solid transparent;
border-bottom: 40px solid transparent;
border-left: 40px solid #99afff;
position: relative;
}
.arrow-left {
display: inline-block;
width: 0;
height: 0;
border-top: 40px solid #EBEBEB;
border-bottom: 40px solid #EBEBEB;
border-left: 40px solid transparent;
}
.arrow-ctr {
display: inline-block;
width: 150px;
background: #EBEBEB;
min-height: 80px;
line-height: 80px;
position: relative;
text-align: center;
}
.arrow-right {
display: inline-block;
height: 0;
border-top: 40px solid transparent;
border-bottom: 40px solid transparent;
border-left: 40px solid #EBEBEB;
position: relative;
}
<div style="display:inline-block;" class="arrow-container">
<div id="zz" class="arrow-ctr-done">
Changed/Tested
Batman
</div>
<div id="zz" class="arrow-right-done"></div>
</div>
<div style="display:inline-block;position:relative;left:-30px" class="arrow-container">
<div id="zz" class="arrow-left-current"></div>
<div id="zz" class="arrow-ctr-current">
Coding Standards
<select>
<option>John Smith</option>
<option>Jane Doe</option>
<option>Howdy Doody</option>
<option>Batman</option>
</select>
<button>Assign</button>
</div>
<div id="zz" class="arrow-right-current"></div>
</div>
<div style="display:inline-block;position:relative;left:-60px" class="arrow-container">
<div id="zz" class="arrow-left"></div>
<div id="zz" class="arrow-ctr">
Manager Approval
</div>
<div id="zz" class="arrow-right"></div>
</div>
<div style="display:inline-block;position:relative;left:-90px" class="arrow-container">
<div id="zz" class="arrow-left"></div>
<div id="zz" class="arrow-ctr">
Implementor
</div>
<div id="zz" class="arrow-right"></div>
</div>
<div style="display:inline-block;position:relative;left:-120px" class="arrow-container">
<div id="zz" class="arrow-left"></div>
<div id="zz" class="arrow-ctr">
Validator
</div>
<div id="zz" class="arrow-right"></div>
</div>

Border With a Square

How do I add a square onto a border between a div and an image? The square will be position on the left or the right depending on the position of the text (if the text is aligned right, the square will be bottom left; if the text is aligned left, the square will be top right).
.item {
flex: 1;
background: #8d0700;
margin-left: 5px;
margin-right: 5px;
padding: 0px;
width: 250px;
border: 5px solid #000;
}
.image img {
width: auto;
height: 450px;
outline: 2px solid rgba(218, 236, 255, 0.6);
outline-offset: -6px;
}
.name {
height: 100px;
text-overflow: wrap;
background-color: #8d0700;
color: #fff;
}
.bottomborder {
border-bottom: 5px solid #000;
}
.topborder {
border-top: 5px solid #000;
}
.name .left {
padding-left: 10px;
}
.name .right {
float: right;
margin-right: 10px;
}
<link href="https://www.w3schools.com/lib/w3.css" rel="stylesheet" />
<div class="w3-container w3-row-padding indexcontainer">
<div class="items">
<div class="w3-col l3 item">
<div class="name bottomborder">
<h3 class="right">Die Casting and Machining</h3>
</div>
<div class="image">
<img src="http://via.placeholder.com/200x200">
</div>
</div>
<div class="w3-col l3 item">
<div class="image">
<img src="http://via.placeholder.com/200x200">
</div>
<div class="name topborder">
<h3 class="left">Plastic Injection Products</h3>
</div>
</div>
</div>
</div>
You can achieve this using pseudoelements.
You can adjust the position as you need. I've used calc() here to take into account the width of the border.
.item {
flex: 1;
background: #8d0700;
margin-left: 5px;
margin-right: 5px;
padding: 0px;
width: 250px;
border: 5px solid #000;
}
.image img {
width: auto;
height: 450px;
outline: 2px solid rgba(218, 236, 255, 0.6);
outline-offset: -6px;
}
.name {
height: 100px;
text-overflow: wrap;
background-color: #8d0700;
color: #fff;
}
.bottomborder:after,
.topborder:before {
content: '';
width: 3em;
height: 3em;
background: black;
transform: rotate(45deg);
position: absolute;
}
.bottomborder {
border-bottom: 5px solid #000;
position: relative;
}
.bottomborder:after {
left: 3em;
bottom: calc(-1.5em - 3px);
}
.topborder {
border-top: 5px solid #000;
position: relative;
}
.topborder:before {
right: 3em;
top: calc(-1.5em - 3px);
}
.name .left {
padding-left: 10px;
}
.name .right {
float: right;
margin-right: 10px;
}
<link href="https://www.w3schools.com/lib/w3.css" rel="stylesheet" />
<div class="w3-container w3-row-padding indexcontainer">
<div class="items">
<div class="w3-col l3 item">
<div class="name bottomborder">
<h3 class="right">Die Casting and Machining</h3>
</div>
<div class="image">
<img src="http://via.placeholder.com/200x200">
</div>
</div>
<div class="w3-col l3 item">
<div class="image">
<img src="http://via.placeholder.com/200x200">
</div>
<div class="name topborder">
<h3 class="left">Plastic Injection Products</h3>
</div>
</div>
</div>
</div>

3 divs 33.3% absolute centered

I am trying to create 3 div's inside parent, but no luck to any attempt i was made.. (that's what i am getting http://prnt.sc/bytx6l)
The idea is to create 3 div's 33% height (i dont want to use height by 137 pixels each).
The second is to have absolute centered any content inside 3 div's.
(that's what i want http://prnt.sc/bytzu1)
PS. I dont want to use just divs
What i am doing wrong? Any help?
body {background-color: #111;margin-left: 0px;margin-right: 0px;margin-bottom: 0px; color: #ffffff;}
#tbl {display: table; width:100%; margin-top:-4px;}
#row {display: table-row; width:100%;}
.title {font-weight:400; font-size: 170%; color:#ebebeb;}
#a {display: table-cell; background-color: #3a3a39; padding: 0px 0px 0px 6px; border-top-left-radius: 8px; border-bottom-left-radius: 8px;
width:170px; text-align: center; }
#a-choose {display: table-cell; background-color: #3a3a39; text-align: center; width:40%;}
#a-left {height: 100%; width:100%; display:block; background-color: rgba(31,30,30,1);}
#empty {display: table-cell; background-color: #3a3a39; width:10px; text-align: center; }
#b {display: table-cell; background-color: #3a3a39; padding: 0px 0px 0px 6px; border-top-right-radius: 8px; border-bottom-right-radius: 8px;
width:170px; text-align: center; }
#b-choose {display: table-cell; background-color: #3a3a39; text-align: center; width:40%;}
#b-left {height: 100%; width:100% ;display:block; background-color: rgba(31,30,30,1);}
.j-left {border:1px solid #dc6210; margin:-1px 4px -1px -4px; border-top-left-radius: 8px; border-bottom-left-radius: 8px;}
.j-right {border:1px solid #dc6210; margin-right:2px; border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
#spacer {display: table-row; height: 6px;}
#block {width:100%; height: 33% /*137px*/;}
<div style="width:800px;height:560px;margin:auto auto;background-color:#262626;margin-top:50px;">
<div id="tbl">
<div id="spacer"></div>
<div id="row">
<div id="a" class="title">1</div>
<div id="a-choose">
</div>
<div id="empty"></div>
<div id="b-choose">
</div>
<div id="b" class="title">2</div>
</div>
<div id="spacer"></div>
<div id="row">
<div id="a" class="j-left" style="height:412px;">LLLLLL-h=412px</div>
<div id="a-choose" style="border:1px solid #dc6210;">
<div id="a-left">
<div id="block" style="">a</div>
<div id="block" style="border-top:1px solid #dc6210;border-bottom:1px solid #dc6210;">a</div>
<div id="block" style="">a</div>
</div>
</div>
<div id="empty" style="background-color: transparent;"> </div>
<div id="b-choose" style="border:1px solid #dc6210;">
<div id="b-left">
<div id="block" style="">b</div>
<div id="block" style="border-top:1px solid #dc6210;border-bottom:1px solid #dc6210;">b</div>
<div id="block" style="">b</div>
</div>
</div>
<div id="b" class="j-right" style="height:412px;">RRRRRR-h=412px</div>
</div>
<div id="spacer"></div>
</div>
</div>
Because #a-choose and #a-left is relative position (by default), height: 33% of #block can not be calculated.
So, you should add style position: absolute to #a-left and position: relative to #a-choose.
This will be helpful.
body {
background-color: #111;
margin-left: 0px;
margin-right: 0px;
margin-bottom: 0px;
color: #ffffff;
}
#tbl {
display: table;
width: 100%;
margin-top: -4px;
}
#row {
display: table-row;
width: 100%;
}
.title {
font-weight: 400;
font-size: 170%;
color: #ebebeb;
}
#a {
display: table-cell;
background-color: #3a3a39;
padding: 0px 0px 0px 6px;
border-top-left-radius: 8px;
border-bottom-left-radius: 8px;
width: 170px;
text-align: center;
}
#a-choose {
display: table-cell;
background-color: #3a3a39;
text-align: center;
width: 40%;
position: relative;
}
#a-left {
height: 100%;
width: 100%;
position: absolute;
display: block;
background-color: rgba(31, 30, 30, 1);
}
#empty {
display: table-cell;
background-color: #3a3a39;
width: 10px;
text-align: center;
}
#b {
display: table-cell;
background-color: #3a3a39;
padding: 0px 0px 0px 6px;
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
width: 170px;
text-align: center;
}
#b-choose {
display: table-cell;
background-color: #3a3a39;
text-align: center;
width: 40%;
position: relative;
}
#b-left {
height: 100%;
width: 100%;
position: absolute;
display: block;
background-color: rgba(31, 30, 30, 1);
}
.j-left {
border: 1px solid #dc6210;
margin: -1px 4px -1px -4px;
border-top-left-radius: 8px;
border-bottom-left-radius: 8px;
}
.j-right {
border: 1px solid #dc6210;
margin-right: 2px;
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
}
#spacer {
display: table-row;
height: 6px;
}
#block {
width: 100%;
height: 33% /*137px*/;
}
<div style="width:800px;height:560px;margin:auto auto;background-color:#262626;margin-top:50px;">
<div id="tbl">
<div id="spacer"></div>
<div id="row">
<div id="a" class="title">1</div>
<div id="a-choose">
</div>
<div id="empty"></div>
<div id="b-choose">
</div>
<div id="b" class="title">2</div>
</div>
<div id="spacer"></div>
<div id="row">
<div id="a" class="j-left" style="height:412px;">LLLLLL-h=412px</div>
<div id="a-choose" style="border:1px solid #dc6210;">
<div id="a-left">
<div id="block" style="">a</div>
<div id="block" style="border-top:1px solid #dc6210;border-bottom:1px solid #dc6210;">a</div>
<div id="block" style="">a</div>
</div>
</div>
<div id="empty" style="background-color: transparent;"> </div>
<div id="b-choose" style="border:1px solid #dc6210;">
<div id="b-left">
<div id="block" style="">b</div>
<div id="block" style="border-top:1px solid #dc6210;border-bottom:1px solid #dc6210;">b</div>
<div id="block" style="">b</div>
</div>
</div>
<div id="b" class="j-right" style="height:412px;">RRRRRR-h=412px</div>
</div>
<div id="spacer"></div>
</div>
</div>
height is relative. Therefore all elements above it must also have a height element in them.
a-left
a-choose
row
tbl
Once you have a height: 100%; in all of these it works.

Right side wrap for ribbon does not vertically align

I'm attempting to make a ribbon for a navbar using bootstrap and my own CSS work. I have the majority of what I need finished, however I cannot seem to make the right side of the ribbon align with the navbar.
(colors purposefully bad to make the example obvious)
Here's an example of my situation: JSBin example
CSS:
nav.navbar {
border-radius: 0px;
border-left: none;
border-right: none;
box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.15), 0 1px 5px -5px rgba(0, 0, 0, 0.075);
box-shadow: none;
}
div.ribbon-left {
left: -13px;
float: left;
width: 13px;
border-right: none;
}
div.ribbon-right {
width: 13px;
float: right;
right: -13px;
border-left: none;
}
div.ribbon-left, div.ribbon-right {
position: relative;
/*background: linear-gradient(to bottom, #fff 0, #f8f8f8 100%) repeat-x;*/
background: white;
height: 100%;
min-height: 52px;
border: 1px solid transparent;
}
div.ribbon-top-back {
z-index: -10;
border-color: transparent transparent #f0f0f0 transparent;
border-style: solid;
border-width: 13px;
height: 0px;
width: 0px;
position: relative;
left: -1px;
top: -27px;
}
div.ribbon-right > div.ribbon-top-back {
left: -14px;
}
/* Temporary coloring to make things obvious */
body {
background-color: blueviolet;
}
.container {
background-color: #c0a16b;
}
html, body, div.container {
height: 100%;
}
A general idea of the ribbon layout:
<div class="row">
<div class="ribbon">
<div class="ribbon-left">
<div class="ribbon-top-back"></div>
</div>
<div class="ribbon-content">
<!-- bootstrap navbar -->
</div>
<div class="ribbon-right">
<div class="ribbon-top-back"></div>
</div>
</div>
</div>
How can I make the element align correctly?
So after some testing, it became apparent that if I wanted the element to be in-line, I would need to declare it before the navbar (seeing as it's relative positioning but float: right):
<div class="row">
<div class="ribbon">
<div class="ribbon-left">
<div class="ribbon-top-back"></div>
</div>
<div class="ribbon-right">
<div class="ribbon-top-back"></div>
</div>
<div class="ribbon-content">
<!-- bootstrap navbar -->
</div>
</div>
</div>

Resources