0

Is it possible to center floated elements.

<div>
 <div class="box">
 </div>
 <div class="box">
 </div>
</div>

.box {
float:left;
width: 600px;
}

When container div will have 1200 or more pixels div.box are near. When less, one after the other but I want center then.

I want to get: center

Piotr
  • 29
  • 2
  • 8

2 Answers2

1

Use @media tag for making it responsive.

@media screen and (max-width: 1200px) {
//write your styles for screen size < 1200px here
}
0

I think margin: 0 auto; will work fine. and also set your containers width in pixels.

Avneesh
  • 149
  • 1
  • 1
  • 7