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 Course Overview

COMBINATORS

i think the "+" and the "~" serve the same purpose. i used the "~" for my style and later change it to "+" but nothing changed. Are they truly the same?

1 Answer

Rick Gleitz
Rick Gleitz
47,197 Points

Hi Khasper,

Based on some quick reading I did (https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors/Combinators), if the selectors you are combining are next to each other, using one or the other will have the same result. If they are not adjacent, you need to use the ~ sign rather than the + sign.

Hope this helps.