I'm trying to make this weird looking divider:
.jumbotron {
background-color: rgba(0, 52, 113, 0.6);
padding: 2em 0;
}
.jumbotron hr {
position: relative;
background-color: white;
border: none;
}
.jumbotron hr:before,
.jumbotron hr:after {
content: '';
position: absolute;
width: 100%;
height: 0;
left: 1px;
border-bottom: 1em solid white;
-webkit-transform: rotate(-135deg);
-moz-transform: rotate(-135deg);
-ms-transform: rotate(-135deg);
-o-transform: rotate(-135deg);
transform: rotate(-135deg);
}
.jumbotron hr:before {
top: 0;
-webkit-transform-origin: 0 0;
-ms-transform-origin: 0 0;
transform-origin: 0 0;
}
.jumbotron hr:after {
bottom: 0;
-webkit-transform-origin: 0 100%;
-ms-transform-origin: 0 100%;
transform-origin: 0 100%;
}
.grid {
display: table;
vertical-align: middle;
border-spacing: 2.46153846em 0;
}
.grid > * {
display: table-cell;
}
<div class="jumbotron">
<div class="grid">
<div>
<h1>This is a headline</h1>
</div>
<hr />
<div>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab rem reprehenderit sit quasi, animi id.</p>
</div>
</div>
</div>
The reason for not using an image is because it is for a responsive site. I can't use extra elements either due to the spacing table-cell
gives.
Now that it has the look I wanted, it still has extra gaps below the :before
and above the :after
. And I am sure I am not doing it the good way.
My question is, is there other way to make that divider with only the hr
element.
`... – André Dion Apr 10 '15 at 17:15
` tag.. technically it should work? I've doubt. – Kheema Pandey Apr 10 '15 at 17:20