Trying to achieve something as the image suggests, and not sure what the best approach would be, because I want to play with divs heights when paired.
The container container should be 100% wide, 100% high and the div inside fully responsive.
Borders, pseudo or backgrounds will not work for this particular case.

HTML
<div class="container">
<div class="top"></div>
<div class="center">
<p>text text</p>
</div>
<div class="bottom"></div>
</div>
CSS
.container{
width: 100%;
height: 100vh;
overflow: hidden;
// transform: skewY(-45deg);
// transform: rotate(-45deg);
}
.top, .bottom {
width: 100%;
height: calc(50% - 20px);
}
.top {
background: black;
}
.bottom {
background: grey;
}
.center {
background: green;
height: 40px;
width: 100%;
}
p {
color: white;
line-height: 10px;
text-align: center;
}
In jsfiddle you will find both rotating and oblique comments.
source
share