If i comment out the first three properties of the .container’s div, the code will partially work (the two children within A won’t completely stretch), but of course I won’t have the properties of the flex-box. How comes that only the two grandchildren of the container behave that way? How can I fix that? Thanks for your help!
At the moment your code behaves the way it does because you’re setting display flex to all divs that are direct children of .container
.container > div
Because the only div with display flex that has children is the one with elements .son1 and .son2 it seems like that’s the only div that gets affected.
I’m not sure what’s the effect that you’re trying to achieve, so correct me if I’m wrong
You want elements .son1 and .son2 to look like when you comment out this part of the code, and menu, content and footer to have display flex?
This is how this example looks like when I load it, what would you like to change here?
I don’t know what do you mean by filling the whole container, maybe you mean this white border around the container?
It’s the default margin that it set on body element, you can remove it like so:
Well, yes, that’s surely an option, but what if later on I’ll want to fill up dynamically a grid (with JS for instance)? Let’s say, for example, that by default I have 4 grids, with their default colors/contents; what if I want to make possible for the user to fill up one of the grids with his images (a sort of upload thing); says, his profile picture and a random photo that rapresents him; if he uploads one, half of the parent is occupied; if two, all the content. An example :