Parkolo11 Parkolo11 - 1 month ago 11
HTML Question

Float divs in bootstrap

How can i get the result, that you can see on the picture? I the col-md-4 divs, i want the 2 divs next to each other. The ikon to the left side, and text next to the ikon.

What i tried, witout any custom css:
Whit this code, the to divs are under each other, and not floating.

echo '<div class="col-md-4 elony">
<div class="elony_ikon_div pull-left">'.$elony['elony_ikon'].'</div>
<div class="pull-right">
<span class="elony_nev">'.$elony['elony_nev'].'</span>
<p class="elony_text">'.$elony['elony_text'].'</p>
</div>
<div class="clearfix"></div>
</div>';


enter image description here

Answer Source

To make the two divs stay next to each other u could start a new div with class row as in:

echo '<div class="col-md-4 elony">
          <div class = "row">
              <div class = "col-md-6">
                   '.$elony['elony_ikon'].'
              </div>
              <div class = "col-md-6">
                   '.$elony['elony_text'].'
              </div>
          </div>';