It's been some time since I encountered a CSS problem, but here I am facing one. In short, I want to highlight text with a gradient background, which I managed to achieve using the <span>
tag and setting a background image on it. However, I ran into an issue when the text wraps onto a new line.
I did find a solution, but it involved messy HTML code, and I prefer not to compromise the cleanliness of my HTML for styling purposes.
The best way to explain this is by showing you an example. Check it out here.
In the provided link, the top <li>
demonstrates the broken style with good HTML, while the bottom <li>
shows how it should look but with undesirable markup.
If anyone has any solutions, I would greatly appreciate them. I'm open to using Javascript or jQuery, but CSS is preferred if possible.
Thank you in advance for any help! :)