My frustration is mounting as I have 4 divs set to float left, but the last one keeps wrapping onto a new line on smaller screens. I want them to scale with the screen size so they always stay on the same line, regardless of the screen size. I'm trying my best to avoid using a table, even though it's very tempting given their reliability in this situation!
I'm seeking advice on how to resolve this pesky issue and ensure that they remain in position, no matter the screen size.
Here is my current 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;
}
This is what my HTML looks like:
<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>
If you have any solutions or tips, please share! :D