James Hayes James Hayes - 1 year ago 65
CSS Question

I want the floating left div's to adjust width on mobile devices

Can any one tell why the

width is NOT adjusted to
as the screen size changes? Is it because I have used
position: relative;


.wrap {
width: 24%;
background: white;
margin: 15px;
padding: 10px;
float: left;
display: inline-block;
overflow: hidden;
position: relative;

@media(max-width: 580px){
width: 48%;

Answer Source

Seems like you just forgot the .wrap and curly braces in the media query:

@media(max-width: 580px) {
  .wrap {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download