I am currently in the process of designing a 3-column grid layout for one of the pages on my website. Some of the elements within this grid span across 2 columns, while others only take up 1 column. However, I am facing an issue with spacing as I want these elements to align organically and minimize any unnecessary gaps or white space. Here is a basic representation of the current state of the page:
And here is the desired outcome:
Take a look at the fiddle here for reference.
Below is the CSS code being used:
*{
color: white;
}
.clear{
clear:both;
}
.out_wrap_blk {
padding: 5px;
background: black;
float:left;
margin: 10px;
}
.out_wrap_gry {
padding: 5px;
background: #323232;
float:left;
margin: 10px;
}
.in_wrap_grn {
border: 1px solid #0CFF0E;
padding: 20px;
}
.in_wrap_blk {
border: 1px solid black;
padding: 20px;
}
.col_1 {
width: 298px;
}
.col_2 {
width: 668px;
}
.col_3 {
width: 1038px;
}
And here is the corresponding HTML markup:
<div id="page_wrap">
<div id="page_head">
<div class="out_wrap_blk">
<div class="in_wrap_grn col_3">
<h1>Test!!!</h1>
Bacon ipsum dolor amet chicken drumstick spare ribs t-bone leberkas brisket pork chop bacon beef ribeye pastrami. Tail bresaola pork andouille cow doner. Kevin short loin turducken picanha swine. Fatback prosciutto shank filet mignon short ribs capicola biltong pork loin landjaeger sausage beef meatball.</div>
</div>
</div>
<div class="out_wrap_gry">
<div class="in_wrap_blk col_2">Andouille doner beef pancetta picanha tenderloin. Boudin picanha ham hock, ham brisket pancetta tongue beef ribs kevin swine.
<br>Ham hock shank tongue pastrami turkey frankfurter. Strip steak pork filet mignon andouille ground round shoulder biltong jowl fatback short ribs pork belly cupim pig. Ground round venison cupim swine cow, jowl chuck tenderloin ham hock tongue jerky. Tail fatback pork loin pig. Tongue frankfurter leberkas kielbasa, hamburger strip steak bacon pork loin chuck biltong meatloaf venison picanha.</div>
</div>
... (additional HTML code)
</div>
How can I achieve this layout without the extra spaces between elements?