How to make children dont overflow with height 100%
I just discovered that
width: auto
and width: 100%
are not the same thing, so I made this script to test it, but now im wondering, how can I make the height 100%
but without overflowing and considering the margins? Do I have to use calc()
?
How do I make the children dont overflow the parent? Because I cant use height: auto
since it just becomes 0
11 Replies
Use min height
minheight: 100?
No what ever hard value
Min-height: 300px;
Setting fixed values won't change based on content
For the child yes you could use min height 100 too
Like that? Doesnt work
Are you setting border box?
no
I'd look up border box, Kevin has a video on it.
I tried border box but it still has problem due the margin
It's there a reason your setting height? Just take it off parent
Let the child determine height
i think i'd do that then, i just set it to the parent because I wanted to know if there was another way to do it
Good rule of thumb is not setting heights on content wrappers and if so use min so it can grow