News for hackers. Stuff that matters.
Re:The Tilde is an Amazing CSS Selector by latch on Wednesday May 16, 2012 @11:36PM (#3985268)
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 could word it properly. This is what I have which I'm not happy with:

"In some ways, the differences between + and ~ are like the differences between the child selector (>) and the descendant selector (a space), in that #header > a will only a elements directly under #header, while header a will target all a elements under #header, regardless of depth.

Re:The Tilde is an Amazing CSS Selector by alanh on Thursday May 17, 2012 @01:08AM (#3985535)
“…sibling element. That is, an element that shares the same parent.”

Unfortunately, that is not true. It only matches following siblings.

See my JSFiddle demo: http://jsfiddle.net/alanhogan/sSVCG/

(Also, HTML comments between elements apparently mess up IE7 and IE8.)

Re:The Tilde is an Amazing CSS Selector by StavrosK on Thursday May 17, 2012 @05:23AM (#3986148)
"+ will select the immediately following sibling, ~ will select any (one?) subsequent sibling" is plenty clear, I think?
Re:The Tilde is an Amazing CSS Selector by neduma on Thursday May 17, 2012 @12:15AM (#3985380)
This is far better then original article. +1