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
Aleksandra Agosto
2,125 PointsHow to put a div next to my nav?
http://codepen.io/anon/pen/EblmK
So with the help of people on the forums, I managed to put 2 divs next to each other for my footer. Unfortunately, I can't seem to replicate this with my nav and .primary div. I want .primary to be to the right of my nav but I can't get it to go there. Tried inline-block but it doesn't seem to do anything. Also tried floating the nav. Anybody have any ideas on what I could be doing wrong?
2 Answers
Ken Alger
Treehouse TeacherAleksandra;
Flexbox will indeed do that, but is not supported by all browsers without additional coding. Not that large of an issue, but if you want to do your site without Flexbox, you could do something like:
#nav {
width: 15%
}
.primary {
width: 85%
}
You can adjust the widths to your liking and add whatever additional formatting you desire.
Hope it helps and best of luck with the site.
Ken
David Omar
5,676 PointsYou also need to float your divs to the left or use a display of inline-block. Divs are block level elements so naturally they will stack on top of each other.
Aleksandra Agosto
2,125 PointsAleksandra Agosto
2,125 PointsWell, never mind! I just founf the flexbox lesson and with the first video, I got it to work :)