How to make two blocks so that they are one on the left, the other on the right (two columns). My right block is moving to the right, but is below the left (as in a normal stream), I also need them to be on the same level. I use floating blocks (float). I tried the clear property, but nothing comes out. I hope, correctly stated the question. Thank.

    2 answers 2

    <style type="text/css"> .container { overflow: hidden; } .container .left_column { width: 50%; float: left; } .container .right_column { width: 50%; float: left; } </style> Контент до <div class="container"> <div class="left_column"> Левая колонка </div> <div class="right_column"> Правая колонка </div> </div> Контент после 

    An example . The columns are assigned different classes, since they will most likely have different indents (for example, if you need to add indentation between the columns).

      If there is nothing to the right of the right block within one parent, then I would make the left block float:left; and the right block is float:right; , they would have rested against the walls of the parent and would be on opposite sides. :-)

      • and still it is necessary not to forget for beginners to remind about the height of elements containing only floating elements inside themselves. And then there will be a mass of surprise in the key, “but why was my cellar to the cap nailed between the speakers?” - Syabrowka
      • @Syabrowka, by visualization, they will be able to guess what's the matter and apply the clear property. :-) - Angelina_Jo
      • Oh, yes, you have not communicated with newbies for a long time :) - Syabrowka