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
John Levy
1,451 PointsHow to fit social media icons directly under the nav bar
I am having trouble fitting my social media icons directly under the nar bar or screens 414px and under. For the other screens I placed the social media icons to the left of the nav bar but for smaller screens I want to place the social media icons centered and under the nav bar. How do I do this? Right now the home tab is inline with the social media icons and the other tabs are under the icons. I have attached my code for the screen width 414px. What am I doing wrong? http://codepen.io/Johned22/pen/vKzAyd Thanks in advance
1 Answer
John Levy
1,451 PointsThanks for the help
Joe Consterdine
13,965 PointsJoe Consterdine
13,965 PointsHi John,
currently your list items are display: inline-block so they go side by side.
What you want to do is make them display:block so they go on top of each other and then go back to display: inline-block when the screen gets wider.
You can do this like this:
So what this does is have them on top of each other at the beginning and then when the screen is 768px or wider it goes back to side by side.
Another point to make is that your 'ul' element has 40px padding to left hand side. This is something the browser does by default so if I were you I'd reset by doing this:
One final point:
Your nav is 320px wide. I'd personally have it wider so your list items can fit on one line.
Any problems let me know.
Joe