Aman Singh Bhogal• 1,010
@asbhogal
Posted
Hi Jhonata,
To make this responsive, you can either use flex-direction: column
in a @media
query or flex-wrap
, or grid
, which would retain the structure. The choice of when to use either depends on the content and how you want it to adapt, but here's a good link explaining the difference between the two. Link
Before you do this however, I'd suggest making several changes to your code because these are causing issues to your layout:
- Remove the
margin-left
on thesection
as this is causing issues with viewport width changes. Presumably this was added to try and centralise the container? In any case, usejustify-content: center
and remove thewidth: 50%
on the.results .sumario
. - You should also remove the
width
on the parent.conteudo
container as explicit values shouldn't be set on this. Set amax-width
instead, with awidth: 100%
, so anything below themax-width
value will occupy the full width of the viewport and above, it will stay at the fixedmax-width
. - Change the
height
to100vh
to keep it vertically centered as, same as above, you shouldn't be using explicit values for these, as they constrain content and cause overflowing issues (ie. when content inside spills outside because the container isn't adapting as it has a fixed value set.)
Hope this helps!
0