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

guys do you know why you can't use justify-content when you have display: inline-flex; and position absolute ?

guys do you know why you can't use justify-content when you have display: inline-flex; and position absolute ? .new-img {

display: inline-flex; position: absolute; margin-top: 20px; justify-content: center; }
If i display them without position absolute is working.But is not helping me because i need position absolute.

2 Answers

Steven Parker
Steven Parker
229,786 Points

Your CSS doesn't contain any offset values, so I'm wondering why you need absolute positioning. Normally, you would not want to mix flexbox and absolute positioning. With flexbox, you are asking the system to position things according to certain rules (such as "justify-content"); but with absolute, you override all rules and specify offsets to position things yourself.

Please show the complete code (both HTML and CSS) if you need more specific help.

Problem solve!