FAQ: CSS Grid Essentials - minmax


#1

This community-built FAQ covers the “minmax” exercise from the lesson “CSS Grid Essentials”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Learn CSS

FAQs on the exercise minmax

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!


#2

Is there a way to control height or width when using minmax(). It seems the property changes at random when adjusting size of the entire grid…


#3

I agree. In this specific exercise, setting the lower bound as 50px, my grid doesn’t appear to ever approach this value, even when significantly narrowing the browser window.


#4

Hello!
Can I use the minmax function in the condensed version of the grid-template or do i need to specify the separate columns and rows?

Any help is appreciated.
Thank you!
Sara


#5

The issue is that the other columns are sized with fr and will only split up what’s left of the width after the others have taken their share. This means the middle column takes it’s max of 300px as long as the grid is wider than 300px.

It is a pretty bad example to show off what minmax does.

But set the first column to a fixed 200px and you will see that it works fine. In a wide window, A is 200px, B is 300px and C takes up the rest. When you are narrowing the window first C will shrink until it can barely contain the letter C then B will shrink until it’s 50px wide and then a scrollbar appears at the bottom of the window because the grid is now at the absolute minimum width.


#6

Thank you, I had the same questions I could stretch the middle columns to max 300px, but I could not reduce it to min 50px…Now it makes more sense.:+1: