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

CSS CSS Selectors Selectors - Beyond the Basics Combinators Challenge

Vasiliki Makropoulou
Vasiliki Makropoulou
2,425 Points

Create a new selector that targets p elements that are adjacent siblings of an h2. Then, set the top margin to .5em

what am i coding wrong?

Grace Kelly
Grace Kelly
33,990 Points

Could you please post your code so we can see what the issue is?? :)

2 Answers

Jason DeValadares
Jason DeValadares
7,190 Points

possibly:

h2 > p {
  top: .5em;
}

the answer for the challenge was this... the above would follow the same layout if I understood your question.

.main-nav > li {
  display: inline-block;
  margin-left:20px;
}
Vance Rivera
Vance Rivera
18,322 Points

You were almost there. You just didn't use the css margin property. Instead you used the top property. This should solve the issue you have here. Cheers!

h2 > p {
  margin-top: .5em
}