CSS How to target element without a tag
I am trying to target text that is not wrapped in any specific tag or wrapper. I am pulling information from wordpress, using wordpress calls, so I won’t be able to edit what I am pulling in.
The HTML/PHP looks like this:
The HTML outputs like this:
I need to hide (and manipulate with jQuery) the text in the content-box, though I can not add any HTML around it to wrap it.
What I’d like to do is initially hide the text and
fadeIn() on hover. So how do I target that text with CSS?
it feels like I need to do something like this:
but that doesn’t do it.
It’s worth pointing out that you can hide the parent element using
visibility: hidden and then display the
h1 element with
visibility: visible. Unfortunately, you can’t do this with the
display property, though.
If you want to wrap the text node with a span, you could use: