I have an textarea element that contains a list of strings. I've written some CSS to highlight the first string (line).
However, this doesn't work well when a long word appears that wraps to a new line:
#example:first-line {
background-color: #BA2F00; /* BazFoo */
color: #F00BA2; /* FooBaz */
}
textarea #example {
word-wrap: break-word;
}
<textarea id="example" style="width: 200px; height: 100px;">
ThisIsALoooooooooooooooooooooongWord
</textarea>
The question is, how do I highlight the entire wrapping first line (i.e. ThisIsALooo...ongWord
) using CSS?