How to prevent div from disappearing? - html

I have made a div structure by using bootstrap grid, however the div with background-color: red always dissapears after you resize the window and make it very small.
Why is this happening and is there a way to prevent it?
Play it: http://www.w3schools.com/code/tryit.asp?filename=F0JT60DW5CHG
.row-sm-3 {
height: 33.33%;
}
#wrap {
height: inherit;
background: red;
}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="container-fluid">
<h1>Hello World!</h1>
<p>Resize the browser window to see the effect.</p>
<div class="col-sm-8 col-sm-offset-2" style="height:300px">
<!-- Black Container -->
<div class="col-sm-6" style="color: white; background:black; height: inherit;">
<div style="height: 25%;"><!-- space top --></div>
<div style="height: 50%;">
<div style="background:red">
<h2 id="sps_einleitung_h2">LOREM IPSUM</h2>
</div>
<div id="sps_einleitung_head_kasten_2">
LOREM IPSUM
<br><br>
LOREM IPSUM
</div>
</div>
<div style="height: 25%;"><!-- space bottom --></div>
</div>
<!-- Black Container -->
<div class="col-sm-6" id="wrap">
<div style="height: 33.33%;position: relative;">
<img src="https://php.quicoto.com/wp-content/uploads/2013/06/css3.jpg" style="width: 50px;position: absolute;">
</div>
<div style="height: 33.33%;position: relative;">
<img src="https://php.quicoto.com/wp-content/uploads/2013/06/css3.jpg" style="width: 50px;position: absolute;">
</div>
<div style="height: 33.33%;position: relative;">
<img src="https://php.quicoto.com/wp-content/uploads/2013/06/css3.jpg" style="width: 50px;position: absolute;">
</div>
</div>
</div>
<div class="col-sm-8 col-sm-offset-2" style="background-color:green; height:200px;">
<div class="row" style="height:inherit;">
<div class="col-sm-6" style="height:inherit; background-color:blue;">
<div class="row-sm-3 row">A</div>
<div class="row-sm-3 row">B</div>
<div class="row-sm-3 row">C</div>
</div>
<div class="col-sm-6" style="height:inherit; background-color:yellow;">
<div class="row-sm-3 row">D</div>
<div class="row-sm-3 row">E</div>
<div class="row-sm-3 row">F</div>
</div>
</div>
</div>
</div>
The red div is always getting under the blue div, why does that happen and how can I solve it?

Imagine you have a bottle of water which can have 1 liter but you want to fill it with 2 liter.
You can't have a parent div with a height of 300px and have 2 children in this which have also 300px. Reduce the height of both children or increase the height of the parent element.
I hope this helped you.
.row-sm-3 {
height: 33.33%;
}
#wrap {
height: inherit;
background: red;
}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="container-fluid">
<h1>Hello World!</h1>
<p>Resize the browser window to see the effect.</p>
<div class="col-sm-8 col-sm-offset-2">
<!-- Black Container -->
<div class="col-sm-6" style="color: white; background:black; height: 300px;">
<div style="height: 25%;"><!-- space top --></div>
<div style="height: 50%;">
<div style="background:red">
<h2 id="sps_einleitung_h2">LOREM IPSUM</h2>
</div>
<div id="sps_einleitung_head_kasten_2">
LOREM IPSUM
<br><br>
LOREM IPSUM
</div>
</div>
<div style="height: 25%;"><!-- space bottom --></div>
</div>
<!-- Black Container -->
<div class="col-sm-6" id="wrap" style="height: 300px">
<div style="height: 33.33%;position: relative;">
<img src="https://php.quicoto.com/wp-content/uploads/2013/06/css3.jpg" style="width: 50px;position: absolute;">
</div>
<div style="height: 33.33%;position: relative;">
<img src="https://php.quicoto.com/wp-content/uploads/2013/06/css3.jpg" style="width: 50px;position: absolute;">
</div>
<div style="height: 33.33%;position: relative;">
<img src="https://php.quicoto.com/wp-content/uploads/2013/06/css3.jpg" style="width: 50px;position: absolute;">
</div>
</div>
</div>
<div class="col-sm-8 col-sm-offset-2" style="background-color:green;">
<div class="row" style="height:inherit;">
<div class="col-sm-6" style="height:300px; background-color:blue;">
<div class="row-sm-3 row">A</div>
<div class="row-sm-3 row">B</div>
<div class="row-sm-3 row">C</div>
</div>
<div class="col-sm-6" style="height:300px; background-color:yellow;">
<div class="row-sm-3 row">D</div>
<div class="row-sm-3 row">E</div>
<div class="row-sm-3 row">F</div>
</div>
</div>
</div>
</div>
Read more about height.

You have added fixed height to first row so that while resizing window second column from first row hide under second row. Add fixed height to two separate column from first row.
replace
<div class="col-sm-8 col-sm-offset-2" style="height:300px">
with
<div class="col-sm-8 col-sm-offset-2">
and
<div class="col-sm-6" style="color: white; background:black; height: inherit;">
with
<div class="col-sm-6" style="color: white; background:black; height: 300px;">

Have you tried changing the z-index?
ex
#wrap {
height: inherit;
background: red;
z-index:10000;
}'

use the css "clear:both" property

Related

How do i put two cards beside each other?

I am trying to get two cards beside each other but no matter what I do they end up underneath each other. I have them in the same row, in the same container but it still won't work.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Home page</title>
<meta charset="utf-8">
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="search-bar.css" rel="stylesheet">
</head>
<body>
<div class ="container-fluid">
<div class="row">
<div class ="col-2" style="width: 170px;">
<div class="card">
<img src="http://placehold.jp/150x150.png" alt="Avatar" style="height: 150px; width: 150px;">
<div class="container">
<h6><b>John Doe</b></h6>
</div>
</div>
</div>
<div>
<div class="card">
<img src="http://placehold.jp/150x150.png" alt="Avatar" style="height: 150px; width: 150px;">
<div class="container">
<h6><b>John Doe</b></h6>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Home page</title>
<meta charset="utf-8">
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="search-bar.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-2" style="width: 170px;">
<div class="card">
<img src="http://placehold.jp/150x150.png" alt="Avatar" style="height: 150px; width: 150px;">
<div class="container">
<h6><b>John Doe</b></h6>
</div>
</div>
</div>
<div>
<div class="card">
<img src="http://placehold.jp/150x150.png" alt="Avatar" style="height: 150px; width: 150px;">
<div class="container">
<h6><b>John Doe</b></h6>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</body>
</html>
Try this,
Some containers removed. Your cards are now in a column each and both columns are inside a row.
col-6 will make the columns 50% width each, you can make them thinner or wider using col-1 to col-12. The cards will also fill that width as long as you do not dictate any card sizes in your CSS!!
Adding class="img-fluid" to the images and removing the styled size you entered will make the images stay at the column width no matter the screen size.
<div class="container-fluid">
<div class="row">
<div class="col-6">
<div class="card">
<img src="http://placehold.jp/150x150.png" class="img-fluid" alt="Avatar">
<h6><b>John Doe</b></h6>
</div>
</div>
<div class="col-6">
<div class="card">
<img src="http://placehold.jp/150x150.png" class="img-fluid" alt="Avatar">
<h6><b>John Doe</b></h6>
</div>
</div>
</div>
</div>
You have two syntax errors:
An extra div closer </div>
and extra body closer </body>
I added class="col" to the second card div
Note by using the forced width on the first column, on small screens you may not see all of that image in columns 1 and 2 set by col-2 you have.
I removed some style= and made classes instead (always try to style wit CSS and classes
We have NO idea what your CSS file does and now this may impact answers negatively. This is the main reason I left some of the markup I would normally NOT do such as the containers around the text on the cards.
.first-column {
width: 170px;
}
.card-image {
height: 150px;
width: 150px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Home page</title>
<meta charset="utf-8">
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="search-bar.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-2">
<div class="card first-column">
<img src="http://placehold.jp/150x150.png" alt="Avatar" class="card-image">
<div class="container">
<h6><b>John Doe</b></h6>
</div>
</div>
</div>
<div class="col">
<div class="card">
<img src="http://placehold.jp/150x150.png" alt="Avatar" class="card-image">
<div class="container">
<h6><b>John Doe</b></h6>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
Second example with standard card use
.card-image.card-img-top {
width: 100%;
height: 150px;
}
.card-img-top {
width: 100%;
}
.card-title {
font-weight: bold;
}
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<body>
<div class="container-fluid">
<div class="d-flex">
<div class="card">
<img src="http://placehold.jp/150x150.png" alt="Avatar" class="card-image card-img-top">
<div class="card-body text-center">
<h6 class="card-title">John Doe</h6>
</div>
</div>
<div class="card">
<img src="http://placehold.jp/150x150.png" alt="Avatar" class="card-image card-img-top">
<div class="card-body text-center">
<h6 class="card-title">John Doe</h6>
</div>
</div>
</div>
</div>
</body>

Bootstrap, allowing content to be responsive/flexible regardless of html layout

So I have a "mostly" functional system that works right now as a CMS: The user goes into an editor and chooses from one of four templates. Within the template they click on a section where they can add images, text or both.
I have a preview screen that shows them what they're making but the issue is that they can create something here where it looks like the image is fitting the space but when it's saved and shown on a huge display it creeps to the top and has a ton of white space below.
So I'm using TinyMCE and when the user saves the info it's saved as HTML in the database, and on my display page (code below) I have that database-driven html coming through a JSON object.
My thing is this: How can I use existing Bootstrap to make sure that regardless of which layout I'm using below (either full width, 2 half width, or a half width with 2 quarter-height half divs) the content within can be more responsive and flexible? I'm trying to get the displayed content to match more closely to what they see on the editor so that regardless of what computer they use to make it, it will be more responseive on the display
This is all of my css and html
html,
body {
height: 100vh;
width: 100vw;
overflow: hidden;
}
iframe{
height:100% !important;
width:100% !important;
}
.middle p{
max-height:100%;
}
.my-container {
display: flex;
flex-direction: column;
justify-content: center;
height: 100vh;
width:100vw;
}
.my-container>.top [class^="col-"],
.my-container>.bottom [class^="col-"] {
background-color: #778899 ;
color: white;
text-align: center;
}
.my-container>.middle {
flex-grow: 1;
padding:30px;
/*background-image: url('images/bg_green.svg');*/
background-size: cover;
}
.my-container>.middle>* {
}
<div class="container-fluid my-container d-flex h-100">
<div class="row top">
<?php include 'banner.php'?>
</div>
<div class="row middle" id="middle" style="background-image: url();">
<!-- Full Page Divs -->
<div class="col-lg-12" id="fullColumn">
<div class="fullContent" id="fullContent" style="height: 100%; ">
</div>
</div>
<!-- End Full Page Divs -->
<!-- Half Page Divs -->
<div class="col-lg-6 leftColumn " id="leftColumn" style="align-items: center;">
<div class="leftContent" id="leftContent" style=" margin:auto; height: 100%; ">
</div>
</div>
<div class="col-lg-6 rightColumn" id="rightColumn">
<div class="rightContent" id="rightContent" style=" height: 100%; ">
</div>
</div>
<!-- End Half Page Divs -->
<!-- Quarter Page Divs -->
<!-- Left -->
<div class="col-lg-6" id="leftColumnQtr">
<div class="row" style="height:50%; padding-bottom: 15px;">
<div class="col-lg-12" style="height:100%;">
<div id="topLeftContent" style=" height: 100%; ">
</div>
</div>
</div>
<div class="row" style="height:50%; padding-top: 15px;">
<div class="col-lg-12" style="height:100%;">
<div id="bottomLeftContent" style=" height: 100%;">
</div>
</div>
</div>
</div>
<div class="col-lg-6" id="rightColumnQtrHalf" >
<div id="rightQtrContent" style=" height: 100%; ">
</div>
</div>
<!-- right -->
<div class="col-lg-6" id="rightColumnQtr">
<div id="leftQtrContent" style="height: 100%;">
</div>
</div>
<div class="col-lg-6" id="leftColumnQtrHalf" >
<div class="row" style="height:50%; padding-bottom: 15px;">
<div class="col-lg-12" style="height:100%;">
<div id="topRightContent" style=" height: 100%;">
</div>
</div>
</div>
<div class="row" style="height:50%; padding-top: 15px;">
<div class="col-lg-12" style="height:100%;">
<div id="bottomRightContent" style=" height: 100%;">
</div>
</div>
</div>
</div>
<!-- End Quarter Page Divs -->
</div>
<!-- End Row Middle -->
<div class="row bottom">
<?php include 'ticker.php';?>
</div>
</div>
Here's a solution based on what I could get about what you wanted. One thing I'd Strongly recommend is not setting width and height before the initial layout is structured. once the skeleton is ready you can start messing with it.
NOTE: I used bootstrap 4.2.1 for testing this.
"//maxcdn.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css"
-- SOLUTION --
I removed all your styles to make things simpler, the styles below are for display purpose only. Feel free to play with it.
<style>
div {
background-color: #00333333;
margin: 0;
padding: 5px;
min-height: 20px;
}
div.row {
background-color: #ff000033;
}
</style>
HTML code
<div class="container-fluid">
<div class="row top">
<h2>something in top</h2>
</div>
<div id="middle">
<div class="row">
<!-- Full Page Divs -->
<div class="col-sm-12">
<h1> FULL PAGE </h1>
</div>
</div>
<!-- End Full Page Divs -->
<!-- Half Page Divs -->
<div class="row">
<div class="col-sm-6">
<h1> left half </h1>
</div>
<div class="col-sm-6">
<h1> right half </h1>
</div>
</div>
<!-- End Half Page Divs -->
<!-- Quarter Page Divs -->
<!-- Left -->
<div class="row">
<div class="col-sm-6" id="leftColumnQtr">
<div class="row">
<div class="col-sm-12">
<h1>topLeftContent</h1>
</div>
<div class="col-sm-12">
<h1>bottomLeftContent</h1>
</div>
</div>
</div>
<div class="col-sm-6" id="rightColumnQtrHalf">
<div class="col-sm-12">
<h1>Right half</h1>
</div>
</div>
</div>
<!-- right -->
<div class="row">
<div class="col-sm-6" id="rightColumnQtrHalf">
<div class="col-sm-12">
<h1>Left half</h1>
</div>
</div>
<div class="col-sm-6" id="leftColumnQtr">
<div class="row">
<div class="col-sm-12">
<h1>top right Content</h1>
</div>
<div class="col-sm-12">
<h1>bottom right Content</h1>
</div>
</div>
</div>
</div>
<!-- End Quarter Page Divs -->
<!-- BONUS: may be this is what you wanted too -->
<div class="row">
<div class="col-sm-6">
<div class="row">
<div class="col-sm-6">
<div class="col-sm-12">
<h1>top Left Content</h1>
</div>
<div class="col-sm-12">
<h1>bottom Left Content</h1>
</div>
</div>
<div class="col-sm-6" id="rightColumnQtrHalf">
<div class="col-sm-12">
<h1>Right half</h1>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="row">
<div class="col-sm-6">
<div class="col-sm-12">
<h1>Left half</h1>
</div>
</div>
<div class="col-sm-6">
<div class="col-sm-12">
<h1>top right Content</h1>
</div>
<div class="col-sm-12">
<h1>bottom right Content</h1>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- End Row Middle -->
<div class="row bottom">
<h2>something in bottom</h2>
</div>
</div>
Let me know if this is what you intended.

Overlapping text on images css

<div class="row">
<div class="col-md-4">
<div class="laptop">
<img src="images/laptop.png" alt="" style="width: 16em;">
<p class="laptop-para">Météo Ravageurs Pytosanitaire</p>
</div>
</div>
<div class="col-md-4">
<div class="laptop">
<img src="images/laptop.png" alt="" style="width: 16em;">
<p class="laptop-para">Collecte et transmission de données</p>
</div>
</div>
<div class="col-md-4">
<div class="laptop">
<img src="images/laptop.png" alt="" style="width: 16em;">
<p class="laptop-para">Systèmes Electriques de commande</p>
</div>
</div>
</div>
I have 3 laptop images and paragraphs. I want to center the text inside each images is there any easy way to do that like positioning?
Just use the Laptop image as background of your divs:
background-image: url('./background-image.png');
You are able to adjust its position through the
background-position-x
background-position-y
properties.
You center the text inside the divs via
text-align: center;
Try This:
.laptop {
position: relative;
text-align: center;
}
p {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
color: #000;
text-align: center;
color: #FFF;
background-color: rgba(0,0,0,0.5);
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<div class="row">
<div class="col-md-4">
<div class="laptop">
<img src="https://www.thinkingtech.in/wp-content/uploads/2017/06/razer-blade-hero-laptop-v2-1.png" alt="" style="width: 16em;">
<p class="laptop-para">Météo Ravageurs Pytosanitaire</p>
</div>
</div>
<div class="col-md-4">
<div class="laptop">
<img src="https://images-na.ssl-images-amazon.com/images/I/81p8pWMLI5L._SX425_.jpg" alt="" style="width: 16em;">
<p class="laptop-para">Collecte et transmission de données</p>
</div>
</div>
<div class="col-md-4">
<div class="laptop">
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRxoLOxqQJVbNVeY3w07pF8pK56mJFAgE6Xi_C0GkLuYRtsXE2t" alt="" style="width: 16em;">
<p class="laptop-para">Systèmes Electriques de commande</p>
</div>
</div>
</div>
here is the code for you :
<!DOCTYPE html>
<html lang="cs">
<head>
<meta charset="utf-8">
<meta name="author" content="Vojtěch Matras">
<title></title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
</head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<div class="container-fluid img-fluid">
<div class="row">
<div class="col-4"></div>
<div class="col-4" style="max-width: 100%; height: auto;"><img src="5.jpg"></div>
<div class="col-4"></div>
</div>
<div class="row">
<div class="col-4"></div>
<div class="col-4"><center>you text goes here</center></div>
<div class="col-4"></div>
</div>
<div class="row">
<div class="col-4"></div>
<div class="col-4" style="max-width: 100%; height: auto;"><img src="5.jpg"></div>
<div class="col-4"></div>
</div>
<div class="row">
<div class="col-4"></div>
<div class="col-4"><center>you text goes here</center></div>
<div class="col-4"></div>
</div>
<div class="row">
<div class="col-4"></div>
<div class="col-4" style="max-width: 100%; height: auto;"><img src="5.jpg"></div>
<div class="col-4"></div>
</div>
<div class="row">
<div class="col-4"></div>
<div class="col-4"><center>you text goes here</center></div>
<div class="col-4"></div>
</div>
</div>
</body>
</html>
you can checkjsut resize the window:https://jsfiddle.net/k3tt2qa4/

How to set child div 100% height of the parent (Foundation 6)?

There are three 33% divs next to eachother. The 1st is an empty div, the 2nd a div containing four images, and the 3rd empty div.
How do I responsively keep these 3 blocks the same height? I'm using Foundation 6.
.block {
background: grey;
}
.block, .imgBlock {
height: 200px;
}
.imgBlock .row .column{
padding: 0;
}
<link href="https://cdn.jsdelivr.net/foundation/6.2.0/foundation.min.css" rel="stylesheet"/>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.2.3/foundation.min.js"></script>
<div class="row small-up-3">
<div class="column block">
</div>
<div class="column imgBlock">
<div class="row small-up-2">
<div class="column">
<img src="http://placekitten.com/200/150"/>
</div>
<div class="column">
<img src="http://placekitten.com/200/150"/>
</div>
<div class="column">
<img src="http://placekitten.com/200/150"/>
</div>
<div class="column">
<img src="http://placekitten.com/200/150"/>
</div>
</div>
</div>
<div class="column block">
</div>
</div>
Use foundation equalizer js. Here is your code using foundation equalizer:
Code:
$(document).foundation();
.block {
background: grey;
}
.block,
.imgBlock {
height: 200px;
}
.imgBlock .row .column {
padding: 0;
}
<link href="https://cdn.jsdelivr.net/foundation/6.2.0/foundation.min.css" rel="stylesheet" />
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.2.3/foundation.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.2.3/plugins/foundation.equalizer.js"></script>
<div class="row small-up-3" data-equalizer>
<div class="column block" data-equalizer-watch>
</div>
<div class="column imgBlock" data-equalizer-watch>
<div class="row small-up-2">
<div class="column">
<img src="http://placekitten.com/200/150" />
</div>
<div class="column">
<img src="http://placekitten.com/200/150" />
</div>
<div class="column">
<img src="http://placekitten.com/200/150" />
</div>
<div class="column">
<img src="http://placekitten.com/200/150" />
</div>
</div>
</div>
<div class="column block" data-equalizer-watch>
</div>
</div>

vertically compressed bootstrap row

I have a code which renders articles into col-md-6 divs inside only one row (as is shown in code below). Each article has different height. The goal is to get (optically) two columns of articles with approximately equal total height.
<div class="row">
<!-- FOR ARTICLE IN ARTICLES -->
<div class="col-md-6">
<article>
<!-- content with variable height -->
</article>
</div>
<!-- ENDFOR -->
</div>
The problem is a white vertical gap between first and third div as is shown in snippet bellow. Is it possible to show third div just below the first without vertical gap?
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<div class="row">
<div class="col-xs-6">
<article style="background: yellow; height: 200px;">
FIRST
</article>
</div>
<div class="col-xs-6">
<article style="background: red; height: 300px;">
SECOND
</article>
</div>
<div class="col-xs-6">
<article style="background: green; height: 350px;">
THIRD
</article>
</div>
<div class="col-xs-6">
<article style="background: gray; height: 200px;">
FOURTH
</article>
</div>
</div>
As mentioned in my comments, masonry.js would be the best approach. If you want something a bit simpler, you could simply re-structure the html see example https://jsfiddle.net/kvb5hb6f/12/
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="row">
<div class="col-xs-6">
<div class="col-xs-12">
<article style="background: yellow; height: 200px;">
FIRST
</article>
</div>
<div class="col-xs-12">
<article style="background: green; height: 350px;">
THIRD
</article>
</div>
</div>
<div class="col-xs-6">
<div class="col-xs-12">
<article style="background: red; height: 300px;">
SECOND
</article>
</div>
<div class="col-xs-12">
<article style="background: gray; height: 200px;">
FOURTH
</article>
</div>
</div>
</div>