I want to divide page into three blocks, each block have to keep aspect ratio (16:9), two of them have to be side by side, third one should be below them. I achieved it, but there is white space between two first blocks. How can i remove it?
https://jsfiddle.net/q3zutvgv/
HTML and CSS:
html,body {
padding:0;
margin:0;
height:100%;
min-height:100%;
width: 100%;
min-width: 100%;
}
.wrapper {
width: 50%;
/* whatever width you want */
display: inline-block;
position: relative;
}
.wrapper:after {
padding-top: 56.25%;
/* 16:9 ratio */
display: inline-block;
content: '';
}
.wrapper2 {
width: 100%;
/* whatever width you want */
display: inline-block;
position: relative;
}
.wrapper2:after {
padding-top: 56.25%;
/* 16:9 ratio */
display: inline-block;
content: '';
}
.main {
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
/* fill parent */
background-color: deepskyblue;
/* let's see it! */
color: white;
}
.main2 {
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
/* fill parent */
background-color: green;
/* let's see it! */
color: white;
}
.main3 {
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
/* fill parent */
background-color: orange;
/* let's see it! */
color: white;
}
<body>
<div class="wrapper">
<div class="main">
This is your div with the specified aspect ratio.
</div>
</div>
<div class="wrapper">
<div class="main2">
div2.
</div>
</div>
<div class="wrapper2">
<div class="main3">
This is your div with the specified aspect ratio.
</div>
</div>