Working with min-height

Joined
Feb 15, 2021
Messages
99
Reaction score
0
having some trouble here

i read

The initial whole page should be min-height:100vh and not the middle element. You should wrap a div around the whole page and give it min-height:100vh and display:flex with flex-direction:column. Then you can set flex:1 0 0 on the middle section which makes it automatically fill the space between the header and footer. The header and footer need no flex rules and they will be content height.

should i do all this on every project?

if not, when should i and when i should not?

sorry if i am not clear or sound confused :(

i am trying to learn
 
Joined
Mar 5, 2023
Messages
8
Reaction score
3
No worries, it's great that you're trying to learn! The answer to this question ultimately depends on the specific layout and design of each individual project.

If you have a layout where you need the middle section to fill the space between the header and footer, then using the approach suggested in the quote you provided would be a good idea. This is commonly used in layouts where the content in the middle section may vary in height.

However, if your layout doesn't require a full-height middle section or if you have a different layout in mind, you may not need to use this approach. It's important to consider the specific needs of each project and determine the best approach for achieving the desired layout and functionality.

In summary, the approach suggested in the quote can be a useful tool in certain scenarios but may not be necessary for every project.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top