Background color not applied

Hey folks,

I’m wokring on this project: https://codesandbox.io/s/news-reader-app-9pnig
It basically collect news article from a News API. I have a div with an id of “news-articles”. This div contains all the news articles which are populated dynamically. I have given a background color to that div but it is not reflecting. I have given the div a height of 100%.
Am I missing something?

Thanks guys!

Your #news-articles is a Flex container/column so it should grow as required. You don’t need the height the constraint.

Not 100% sure here, but my guess is that the HTML/CSS loads first before the JS gets the data and your container is fixed to 100% of an empty container. You could remove it or use a min-height

2 Likes

I’d mark that as the solution @pragyes31.

2 Likes

Thanks @pjonp! I should of thought of it. :slight_smile: It worked.

1 Like