The gazillionth non-reproducible question was posted on Stack Overflow: How do I select elements with contentEditable = true in CSS?
Two answers appeared, one at least concluded that if the code in the question didn't work for the OP, it meant the browsers was IE6 or similar. IMO improbable, but whatever.
But the other answer just said the code worked fine and suggested some random guesses like refreshing the cache or using jQuery (I guess it's well-known that jQuery is really great and does all things). So I flagged it as not an answer. A moderator quickly declined it.
A previous, similar case is this answer, which just suggests using a normalize css file for a problem not related at all with the default user-agent stylesheet. Some moderator also declined the flag despite the community consensus about removal.
I ran the code [...] and I do not get any errors. [OP's code] There must be something going on with your html anchor or http vs https possibly.
People are just posting random guesses completely unrelated to the problem, maybe because they didn't understand the problem, didn't care to reproduce it, or because it cannot be reproduced at all.
Some of these flags are (luckily not often) being declined by moderators. I don't like this.
contentEditable
property might not update the attribute, but it does (it's not a simple reflection, though): spec. So it seems[contenteditable="true"], [contenteditable=""]
is enough to select elements where content edition is enabled.[contenteditable="true"], [contenteditable=""]
or:not([contenteditable="false"])
?:not([contenteditable="false"])
must be checked on all intermediate elements. In that case I would use:read-write
(excludinginputs
?):not([contenteditable="false"])
will match non-editable elements which don't have anycontenteditable
nor are descendants of an element with a truecontenteditable
, and also it will match non-editable descendants of an element withcontenteditable="false"
. I wouldn't use that selector.user-select
, which is not inherited, butuser-select: none
affects the descendants, but implementations disagree with the spec draft and allow text selection to be reenabled, which is usually done on contenteditable elements via a:read-write
selector in the default style sheet. This all makes things more confusing.