div.bdr {
padding-bottom: 5px;/* to be used to draw a transparent line */
background: #1B4046;
background-clip: content-box;/* here comes the 5 transparent pixel line */
box-shadow: -273px 5px 0 #1B4046, 274px 5px 0 #1B4046;
/* move shadow far away to only draw them by bits
Notice, wrapper must be hidding overflow */
margin-bottom:2em;
}
.bdr.bg-color{
background-color:tomato;
background-image:linear-gradient(to top, transparent 5px, #1B4046 5px);
background-clip:border-box;
}
div.bdr:after {
content: '';
height: 30px;
width: 30px;
padding: 5px;
display: block;
margin: auto;
z-index: -1;
transform: rotate(45deg);
margin: -20px auto -20px;
background: #1B4046;
background-clip: content-box;/* again, keep some parts transparent */
box-shadow:6px 6px 0 -1px #1B4046;
}
.bdr.bg-color:after {
z-index:0;
padding:5px 0 0 5px;
border:5px solid transparent;
border-left:0;
border-top:0;
box-shadow:6px 6px 0 -1px #1B4046;
background:linear-gradient(to bottom right, transparent 50%, #1B4046 50%) no-repeat , linear-gradient(to bottom right, transparent 50%, tomato 50%) 5px 5px no-repeat;
}
article {
width:500px;
margin:auto;
color:white;
}
h1 {
text-align:center;
}
div.shapebdr {
padding-bottom: 40px;
margin: 32px 0;
background: linear-gradient(to top, transparent 30px, #1B4046 30px, #1B4046 35px, transparent 35px) bottom left, linear-gradient(to top, transparent 30px, #1B4046 30px, #1B4046 35px, transparent 35px) bottom right, linear-gradient(to top, transparent 40px, #1B4046 40px) bottom;
;
background-repeat: no-repeat;
background-size: 230px 100%, 230px 100%, 100% 100%;
position: relative;
}
div.shapebdr:after {
content: '';
height: 40px;
width: 40px;
padding: 10px;
display: block;
margin: auto;
z-index: -1;
background: inherit;
transform: rotate(45deg);
margin: -40px auto -20px;
background: linear-gradient(to top, #1B4046, #1B4046) no-repeat, linear-gradient(to top, #1B4046 0, #1B4046 5px, transparent 5px) no-repeat right, linear-gradient(to left, #1B4046 0, #1B4046 5px, transparent 5px) no-repeat bottom right;
background-clip: content-box, border-box, border-box;
background-size: auto auto, 57% 100%, 100% 57%;
}
div.br:after {
margin: auto;
margin-bottom: -40px;
}
article {
overflow: hidden;
padding-bottom: 40px;
}
html {
min-height: 100%;
background: linear-gradient(30deg, gray, yellow, purple, lime, tomato, turquoise, gray);
}
p {
padding:0.25em;
margin:0.25em;
position:relative;/* make sure text shows over the pseudo element */
}
<article>
<h1>border and shadow approach </h1>
<div class="bdr">
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est.
facilisis luctus, metus</p>
</div>
<h1>gradient approach</h1>
<div class="shapebdr">
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est.
lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor,
facilisis luctus, metus</p>
</div>
<h1>shadow + gradient approach to fill translucide line</h1>
<div class="bdr bg-color">
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est.
lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor,
facilisis luctus, metus</p>
</div>
</article>