Hello. I can't get the div to appear as a block element.

<div style="display:block;"> <div style="float:left"> <img src="/public/content/2.jpg" alt="dddd" class="preview"> </div> <div style=" float:left; margin: 30px;"> ффффф<br/> ыыыыыыы </div> </div> <div style="display:block;"> <div style="float:left"> <img src="/public/content/2.jpg" alt="dddd" class="preview"> </div> <div style=" float:left; margin: 30px;"> рррр<br/> фффффф </div> </div> 

The problem is that <div style = "display: block;"> is displayed in a string. How to make them appear as a block element of the page?

If the first block has <div style = "display: inline-block;">, then everything is displayed as intended.

    1 answer 1

    make

     <div style="display:block;clear: both;"> 

    the fact that it is a block does not in itself cancel the float: left