Wrote such code. It is planned that on the left in each block there will be a picture, and on the right will be the name above, below the description. But the problem is that the block with the text because of the length takes up all 100% of the block and is transferred to the next line.
How to make the text not transfer to the next line, while maintaining flexibility, that is, without specifying the width of the blocks, can it constantly change later?
JSFiddle: https://jsfiddle.net/6arnozcs/
.clearfix:after { content: ""; display: table; clear: both; } .shop_block { max-height: 300px; overflow: auto; width: 400px; } .shop_item { background: #ccc; } .shop_item:hover { background: #999; } .shop_item>div { float: left; } .shopitem_cont { height: 64px; overflow: hidden; box-sizing: border-box; padding: 5px 10px 3px 8px; } .shopitem_head { font-size: 18px; padding: 0 0 3px 0; margin: 0 0 3px 0; border-bottom: 1px solid #000; } <div class="shop_block"> <div class="shop_item clearfix"> <div class="shopitem_image"> <img src="http://placehold.it/64x64"> </div> <div class="shopitem_cont"> <div class="shopitem_head">Item 0</div> Description is here. На самом деле описание настоооолько большое что просто не влазит в этот блок. </div> </div> <div class="shop_item clearfix"> <div class="shopitem_image"> <img src="http://placehold.it/64x64"> </div> <div class="shopitem_cont"> <div class="shopitem_head">Item 0</div> Description is here. На самом деле описание настоооолько большое что просто не влазит в этот блок. </div> </div> </div>