Solutions:
-
Because the “name” style contains “flex: 1”, the name text is flexible. This means it may grow or shrink depending on how much space is available in its container. Now this is important: the description text is really tall -- so tall that it uses up all the space in the container and it still sticks out. Therefore, the flexible items in the same container are shrunk to make room for the description text. Because the description is too tall, the name text is compressed to 0 height. That’s why it’s invisible. Phew…
-
Now when the hat image is made flexible, it gets shrunk too. This time, because the image can be shrunk down quite a bit -- to the point that the container has enough room for all its children, including the tall description text that used to stick out. Now, everybody is happy. The name, hat image, description text are all displayed correctly. Notice the last line of the description “<= The end”. It was not visible before since the description stuck outside of its container.
3