I used CSS : before and : after to create a document that looks like a layout with a div. This is good, but the width increases as the height increases. I tried max-width but to no avail. Any ideas on how this can be prevented.
HTML
<div class="rack"></div>
CSS
.rack {
width: 70%;
height: 100%;
background: #7FAE68;
margin: -255px 0 100px 0;
position: relative;
float: left;
left: 15%;
z-index: 9999;
transform:rotate(1deg);
-ms-transform:rotate(1deg);
-webkit-transform:rotate(1deg);
padding-bottom:50px;
}
.rack::before {
content: "";
background: #E1BB70;
position: absolute;
height: 100%;
width: 100%;
z-index: -2;
transform:rotate(1deg);
-ms-transform:rotate(1deg);
-webkit-transform:rotate(1deg);
float: left;
left: 0%;
}
.rack::after {
content: "";
background: #E5E8EC;
position: absolute;
height: 100%;
width: 100%;
z-index: -1;
transform:rotate(-1deg);
-ms-transform:rotate(-1deg);
-webkit-transform:rotate(-1deg);
border: solid 1px #ddd;
left: 0%;
}
Before height increase

After height increase

jsfiddle link
Double content in the violin to witness the problem.
source
share