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!
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
Austin Grandt
Courses Plus Student 4,811 PointsBootstrap Nav Button Margin
I have created a site using Twitter Bootstrap and have a login and register button in the navigation. It looks fine when the nav is at the top, but when it switches to mobile version the buttons are pushed up the left side of the mobile nav.
Does anyone have any suggestions how to get about 5px of space between the left side of the nav and the buttons? I have tried a bunch of different css properties, but can't seem to get anything to work.
Thanks!
4 Answers

Justin Allen
4,558 Pointsadd the class "mobile-margin-btn" to the buttons then add this in your css style sheet. You can convert the px to % I didn't. Hopefully this gives you the result I think you are looking for.
.mobile-margin-btn { margin-left: 12px; }
This is the one thing I'm not a fan of about bootstrap. But it's quick and gets the job done so hacks I guess are part of the game. Let me know.

Justin Allen
4,558 PointsCan you post the code and example? I think I know what you're going thru and it's a downfall of bootstrap kind of being at the mercy of there framework. My first thought is maybe put them in col-xs-6 but I would have to see it before making that official. haha

Austin Grandt
Courses Plus Student 4,811 PointsHi Justin,
I posted the code above. Thank you for the response!

Austin Grandt
Courses Plus Student 4,811 PointsThanks Justin for the Answer! I actually ended up taking your CSS and making the mobile-margin-btn class like you suggested only visible in the xs (mobile) size. Thanks for the help!
Austin Grandt
Courses Plus Student 4,811 PointsAustin Grandt
Courses Plus Student 4,811 Points