I'm putting together a layout using Bootstrap 3 and wanted to do a layout like this:
+-------------+---------------------------------+
+-------------+ +
+-------------+ +
+---height----+ Conteúdo aqui +
+----100%-----+ +
+-------------+ +
+-------------+ +
+-------------+---------------------------------+
And when moving to smaller screens (768px or smaller) the layout should look like this:
+-----------------------------------------------+
+--------------height do elemento---------------+
+-----------------------------------------------+
+ Conteúdo aqui +
+ +
+ +
+-----------------------------------------------+
My difficulty is to put the height of the element to the left (dashed) with height 100%. on large screens, and when moving to small screens, stay as high as the internal contents. How can I do this? Here is the code I'm using.
.esquerda {
background-color: red;
height: 100%;
}
.direita {
background-color: blue;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<div class="row">
<div class="col-sm-4">
<div class="esquerda">
Conteudo da esquerda
</div>
</div>
<div class="col-sm-8">
<div class="direita">
Conteudo da direita
</div>
</div>
</div>