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


Arikaturika Tumojenko
Arikaturika Tumojenko
8,897 Points

Order of columns changed after using display: inline-block;

I used "display: inline-block;" to create a 3 column layout and when I did that the order of the columns changed and they appear like: secondary - tertiary - primary.

You can see the code here

Why is this happening if in the HTML the order is secondary-primary-tertiary? Thank you.

1 Answer

Steven Parker
Steven Parker
229,982 Points

The secondary has a float: left setting, so it will always be the first one on the left. The primary has a float: right setting, it will always be the last one on the right. All the display: inline-block does is to determine if the tertiary will go in between the others or down below.