Need help with @media query

Does anyone know how I can get the text that is in a grid to be centered in the most narrow view? (In the About Me section) If you drag the website to the most narrow view you will see what I am talking about.

which part are you talking about ? about me “paragraph” or “grid” at bottom?!

You should give the content a container and constrain the max width and center it using an auto margin instead of all that left/right padding. You can replace the 25rem with a viewport unit as well padding: 4rem 10vw but it isn’t really the correct solution.


Also, the .grid has width: min(640px, 85vw). That only works when it is not inside an outer container with constraints on it (be it padding or max-width). You can think of it as a max width of 640px and the 85vw acts as padding not letting the element get to 100% width and so never touching the edge of the container/viewport. You have to set the second value to 100% if you want the parent to constrain the width and still have it centered width: min(640px, 100%).

1 Like

Thank you so much! That helped a lot

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.