Doing this pseudo zen garden exercise and i’m not touching the mark up. But I’m looking to see if I can :
a) set the value of the placeholder in CSS3 only and
b) override what’s currently set, which is ‘Search…’
I was looking @ the ::after/::before pseudo-elements. But my 1st few attempts were null and void. Will keep at it. But this is a curious one. Anyone w/ wisdom on this one?
For example, if the text was contained in it’s own element, you could hide it in a myriad of ways and then generate the replacement text using a pseudo element. OR you could use text-indent to hide the text like this:
p {text-indent:-999999em;}
p:after{ content:'replacement string'; display: block; text-indent:0 ; }
or if it was a word in a block of text ( lest say one wrapped in a B tag)
In this case, though, we’re talking about the placeholder attribute on form elements—or that’s my assumption—which can’t be negative indexed, as far as I know.
Though I may be misunderstanding the question entirely, so an example would help to clarify.
I believe the OP was talking about hiding the placeholder text using :before or :after tocover it up but as replaced elements do not have (or are not supposed to have) a :before or :after then it is not possible unless you used the :before or :after of the label element and positioned some content on top of the input which would be quite awkward unless the mark up was exactly right to start with