0

What does tilda (~) symbol in CSS selector mean?

I've read in leaflet css that uses ~ in the selector. .leaflet-sidebar.left.visible ~ .leaflet-left { left: 100%; }

12th Feb 2017, 1:56 AM
Rizky Firmansyah
Rizky Firmansyah - avatar
2 Answers
+ 6
~ selects every element (on the right) that has the left-side element before it. So this code selects .leaflet-left if it's directly after .leaflet.sidebar.left.visible.
12th Feb 2017, 2:27 AM
Tamra
Tamra - avatar
+ 1
Got it! Thanks tamra for your concise explanation. 😊
12th Feb 2017, 4:12 AM
Rizky Firmansyah
Rizky Firmansyah - avatar