Hello. There is a block with a background, a description and a form in it. demonstration Why does the form have the same height as the parent <div class="product-frame">
? I want to place the form to the right of the description without changing the html structure, but if I just add the width. .content-description { width:50%; }
.content-description { width:50%; }
in the form form { float:left;}
, the background of the block is deleted, while removing overflow: hidden;
gives nothing. What can be done?
.product-frame { background-color: blue; position: relative; z-index: 1; } .content-description { float: left; overflow: hidden; }
<div class="product-frame"> <div class="content-description"> <p>ΠΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅</p> <p>ΠΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅</p> <p>ΠΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅</p> </div> <form method="post"> <input type="hidden" name="add-to-cart" value="3350"> <input type="hidden" name="product_id" value="3350"> <input type="hidden" name="variation_id" value="3357"> <button type="submit" class="add_to_cart_button">ΠΡΠΏΠΈΡΡ</button> </form> </div>
The addition of overflow:hidden;
helped overflow:hidden;
containing div and
.content-description { float:left; width:50%; overflow:visible; } form { float:left; width:50%; }
The result is here.