Mistake in Video
Hey @Kevin, I just wanted to point out a mistake in one of your videos, but I might be wrong, so please correct me if I am.
So, you were talking about the adjacent sibling combinator in this video: https://www.youtube.com/watch?v=cuEHx9DoWI4&list=PL4-IK0AVhVjNqiPli_PSfoD-hv1Y4dIsK&index=2
So, at 1:57, you explained the adjacent sibling combinator as: "Does this one here, have an
example
before it?"
I think the correction is: Does this element with a class of example
comes immediately after another element with a class of example
?
The same process can be applied to your example when you replaced .example
with div
: div + .example {}
.
You mentioned, "Is there a div before it?"
But I think it should be: Does this element with a class of example
comes immediately after another div?
Obviously, I worded mine more verbosely so it would be easier to understand but the main point I'm trying to put across is the use of after would be more appropriate than saying before
Love your vids btw3 Replies
I think both are right?
"Does this have X before it" is the same as "does this come after X"
In my mind, I always see it as "does this have X before it" is the way the selector is...
.one + .two
I always think: "does two have a one before it", since I read the selector backwards, since CSS starts at the right and goes to the left.
But saying "does two come after one" might be a bit more clear from a language POV, it's a bit cleaner of a way to say itYeah, I agree with you
Thanks! 🙏