I want to make the first line of a paragraph bold only when the user hovers over the first line of the paragraph. I tried something like:
p::first-line:hover {
font-weight: bold;
}
Please note that this question is different from another Stack Overflow question. The referenced question is about how to make the first-line of the paragraph bold when the user hovers over any part of the tag. My question is how to make the first-line bold when user hovers only over the first line.
How you have tried it is correct per the relevant CSS specification:
However, this specific feature combination is not yet implemented in any browsers (e.g. Firefox v123 and Chromium v123). Feel free to test with this Stack Snippet; when it works, you'll know your browser has implemented the feature:
In the future, browsers may support this, and this answer can be updated at that time. In the meantime, you'll need to use JavaScript to achieve that functionality.