Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
}