Prevent float left div from going to a new line

css, html

Solution

Hi i think you should this check to this 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>

Problem

I have 4 divs that are set to float left but the end div keeps wrapping two a new line on a smaller screen which is really annoying me...i want them to scale with the screen size so they always stay on the same line regardless of screen size... and im trying not to use a table (which is very tempting giving they v.reliable for this!!!) I'm wondering how to fix this annoying issue so they always stay in position regardless of screen size?? I have this as my 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 help :D

Original source