CSS layout with left and right column?

Is there a solid cross browser solution for fixed and fluid CSS columns? I need one column to be docked on the left side and another column to be docked on the right side.

Below is a snippet of my code - .promoImg and .promoContent float next to each other. #recommends is 90% of the browser width, .promoImg needs to be fixed at 120px, and I would like .promoContent stretch the fluid.

 <div class="promoBlock "> <div class="promoImg"> fixed content 300px </div> <div class="promoContent"> fluid content </div> </div> 
+6
source share
1 answer
 .promoBlock { width:90%; margin:auto; } .promoImg { width:300px; float:left; background-color:red; } .promoContent { margin-left:300px; background-color:green; } 

Code: http://jsfiddle.net/P4RBj/

PS: Failed to get promoblock to fix at 120px . If so, your inner div is wider (300 pixels).

+15
source

Source: https://habr.com/ru/post/902236/


All Articles