The way that w3schools phrases it, they sound the same.
div + p
Selects all<p>
elements that are placed immediately after<div>
elements
div ~ p
Selects every<p>
element that are preceded by a<div>
element
If a <p>
element is immediately after a <div>
element, doesn't that mean that the <p>
element is preceded by a <div>
element?
Anyhow, I'm looking for a selector where I can select an element that is place immediately before a given element.
See Question&Answers more detail:os