I successfully created a sensitive grid, as the fragment shows.
Currently, I see the fields aligned to the left.
How can I put the container in the center of the page without using a pad?
I tried using margin:auto , but that did not work.
.container{ display:flex; flex-wrap:wrap; text-align:center; margin:auto; } .box{ width:100%; max-width:30%; border:1px solid red; margin:5px; } @media only screen and ( max-width:768px ){ .box{ width:100%; max-width:40%; border:1px solid red; } }
<section class="container"> <div class="box"> <h1>This is the first box</h1> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci voluptates, aut totam eaque possimus molestiae atque odio vero optio porro magni, quis culpa ea. Perferendis, neque, enim. Rem, quia, quisquam.</p> </div> </section>
JS Fiddle .
source share