The Tilde is an Amazing CSS Selector
21–30 of 31 posts
Re: The Tilde is an Amazing CSS Selector
#22There already are many CSS3 sliders created using the 'tilde' selector. http://cssdeck.com/item/348/pure-css3-content-slider http://cssdeck.com/item/308/awesome-rotating-css-image-slide... http://cssdeck.com/item/153/solitary-css3-slider-rotation-tr... http://cssdeck.com/item/363/simply-css-image-slide http://cssdeck.com/item/364/pure-css3-slideshow-without-page...
Oh, that’s what he meant by slider? Why do some people call these sliders? Things that show a series of images are called carousels (because they rotate!). And what if your “slider” (carousel) fades instead of transitioning with a horizontal wipe? Not sliding then! Sliders are things you drag and drop to select a value within a range (like a volume slider). Had not seen carousels called “sliders” until two days ago,…
Re: The Tilde is an Amazing CSS Selector
#23Earlier quoted context omitted.
You are definitely right. That isn't CSS. I'm not sure what it is.
It's SCSS
#container #findMe { /* ... */ }
#container input:checked ~ #main > #findMe { /* ... */ }
(or) #container > #findMe { /* ... */ }
#container > input:checked ~ #main > #findMe { /* ... */ }Re: The Tilde is an Amazing CSS Selector
#24Careful not to misunderstand the syntax. The linked article confusingly has this example: input:checked ~ #main > #findMe … described thusly: “With the tilde character on #container input:checked would be able to target #findMe …” Please note the tilde has nothing to do with #findMe. The tilde only relates the input element and #main, which are in-order siblings. (Adjacent in-order siblings, in fact, so + would have…
Re: The Tilde is an Amazing CSS Selector
#25This post abuses IDs. If you have something with the ID #main, it should be unique anyways or else you have invalid markup. If it's unique, why do you need a sibling selector to find it? This post could be improved by using classes: #container input:checked ~ .main > .findMe { ... } But really, the sibling selector is powerful enough that you might not need classes at all. I think the following selector makes a much…
That selector is not to find it, it's to say #main IS a sibling. If #main exists but is not a sibling then apply different css to it.
Re: The Tilde is an Amazing CSS Selector
#26Re: The Tilde is an Amazing CSS Selector
#27Re: The Tilde is an Amazing CSS Selector
#28Can't say I understood what it does from that post, so here's another description: http://reference.sitepoint.com/css/generalsiblingselector
I had no idea what ~ did after reading that post. Should have simply stated that: "The tilde (~) selector lets you target a sibling element. That is, an element that shares the same parent" Could then explain how it's different than the + selector. "This differs from the + selector which will only find an adjacent sibling (immediately following)." I'd consider comparing it to the child and descendant selector, if I c…
Re: The Tilde is an Amazing CSS Selector
#29There already are many CSS3 sliders created using the 'tilde' selector. http://cssdeck.com/item/348/pure-css3-content-slider http://cssdeck.com/item/308/awesome-rotating-css-image-slide... http://cssdeck.com/item/153/solitary-css3-slider-rotation-tr... http://cssdeck.com/item/363/simply-css-image-slide http://cssdeck.com/item/364/pure-css3-slideshow-without-page...
Oh, that’s what he meant by slider? Why do some people call these sliders? Things that show a series of images are called carousels (because they rotate!). And what if your “slider” (carousel) fades instead of transitioning with a horizontal wipe? Not sliding then! Sliders are things you drag and drop to select a value within a range (like a volume slider). Had not seen carousels called “sliders” until two days ago,…
Re: The Tilde is an Amazing CSS Selector
#30Hmm, I wonder if we can simulate a Turing machine in css nowadays...