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 trialdeepak sharma
3,844 Pointswhy dont be use margin-right in adjacent selector in .btn + .btn.. and why is it not working
.btn + .btn { margin-right: 20px; }
2 Answers
Robbie Baker
7,736 PointsThe btn + btn wouldn't tag the first button but in this case the one right next to it. (or any following the first button if more than 2). If you would use a margin-right it would leave both buttons very close to each other and then with the 3rd there would be the 20px gap.
Also could you please post your code so we could help?
I made the mistake of not putting this code in the original media query from earlier.
It should look like the following:
@media (min-width: 769px) { .inln { width: auto; display: inline-block; } .btn + .btn { margin-left: 20px; } }
Jason Anello
Courses Plus Student 94,610 PointsHi deepak,
To get some separation between the submit and reset buttons, you could either apply a right margin to the submit button or a left margin to the reset button.
Guil is using the selector .btn + .btn
This will target any button that follows another button.
In this case, the reset button follows the submit button and so that selector will target the reset button.
Because you're targeting the reset button you would want to apply a left margin.