Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

[Flexbox]: Display: block not working in flex children

I have a container that is set up to display as flex. The children are individual divs with content inside of them. However, when I try to set the display of items within the divs to "block," it doesn't work. When I pull up the inspect-items console in my browser, it says that CSS is ignoring this command (the "display: block" command for the divs).

I'm not sure we're getting the full picture here. Can you please share your CSS code?

2 Answers

I think you don't need to set the display of the items within your divs to "block" anymore because these flex items (divs) are already inheriting the container's flex property, which is also a block-level container.

ya! man if you're using a flexbox you don't need to use the display to fix it

like this :

display: flex;

and not:

display: block;

because when you're using flex you need to follow along all context in flexbox I will to Leave a link for you traning your skills in flexbox http://flexboxfroggy.com follow all these examples and to answer all question in this game so I hope help you , good luck! ..