I would like to style the text following the span tag using CSS without affecting the span tag itself. Specifically, I want to apply styling only to the text that reads "Text to be selected", leaving the span tag unaffected.
The style I desire is for the text "Text to be selected" to have a display property of none, while keeping the span tag visible and unchanged.
<a>
<span> Cricket </span>
Text to be selected // only this text should be hidden with 'display: none'
</a>
This effect can potentially be achieved using a font size manipulation technique. By setting the font size of one element to zero and the other to a specific value, we can simulate the desired outcome.
A potential workaround:
This effect can be mimicked by manipulating font sizes. Set the font size of the containing a
tag to zero, while adjusting the font size of the nested span
tag to its default or a specified value.
a {
font-size: 0;
}
a span {
font-size: initial; // or specific numeric value
}