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
Sean Klaubo
1,742 PointsMultiple elements? Inside a nav bar
I have went through a ton of the html and css tutorials, but i am sorta stuck on this one, i am trying to add in links and image links to my top nav bar, but i want to be able to position them separately. Like i would want my links to align to the left side of the page, and my little icons of facebook, and twitter to the right of the nav bar. I should note i am trying to do a constant nav that display's at the top of the page. Using a div id ="nav" then just setting the links with <a href="#"> The nav works, just when i make a new class it goes under the nav..
5 Answers
Kevin Korte
28,149 PointsWithout playing with actual code and seeing the structure; it sounds like you had one unordered list of menu icons floated left, and another list floated right, you'd get what you want.
Try creating a codepen.io and linking back that pen's unique URL here so we can help you more.
Sean Klaubo
1,742 Pointshttp://cdpn.io/baLmz I did not know about this website, thanks! But in this code the facebook icon would be to the right of the text, i want them on the bar, but in different classes so i can manipulate them separately.
Chris MacDonald
5,166 Pointsthat codepen link didn't work for me, nothing was in there, if what kevin is saying right (some floating left others floating right), try floating everything in one direction and using margins to get them where you want. The css deep dive does cover floating elements. Hope that is understandable.
Sean Klaubo
1,742 PointsKeep in mind all the code is only a black bar across the top with 2 links, the facebook icon wont show cause it's currently a directory in my pc. I will take a look at floats again..
-edit http://codepen.io/zema/pen/nfqJb sorry for the double posting, had to work and i figured out how to post the code, the issue i have is the face book icon is behind the navigation.
Sean Klaubo
1,742 PointsSPAN TAG! friend helped me with that i needed a span tag /facepalm