html - Prevent float left div from going to a new line -
i have 4 divs set float left end div keeps wrapping 2 new line on smaller screen annoying me...i want them scale screen size stay on same line regardless of screen size... , im trying not use table (which tempting giving v.reliable this!!!)
i'm wondering how fix annoying issue stay in position regardless of screen size??
i have css:
.wrapper{ margin:0 auto; width: 80%; display: table-cell; } .gridf{ float:left; margin-right:3px; width:200px; min-height:200px; border:1px solid white; } .grid{ float:left; margin-left: 3px; margin-right:3px; width:200px; min-height:200px; border:1px solid white; } .gridl{ float:left; margin-left: 3px; width:200px; min-height:200px; border:1px solid white; } my html:
<div style="overflow: hidden;"> <div class="wrapper"> <div class="gridf"></div> <div class="grid"></div> <div class="grid"></div> <div class="gridl"></div> </div> </div> please :d
hi think should check demo
.wrapper { margin: 0 auto; width: 80%; border: solid 1px red; overflow: hidden; } .gridf, .grid, .gridl { background: green; width: 24%; min-height: 100px; float: left; margin: 2px 0; } .gridf {} .grid { margin: 2px 1%; } .gridl { background: yellow; } <div class="wrapper"> <div class="gridf">one</div> <div class="grid">two</div> <div class="grid">three</div> <div class="gridl">four</div> </div>
Comments
Post a Comment