I changed the text highlight color using ::selection, which works pretty in my page. However, I found the Chrome behaves different from FF, which highlight the <br> with default blue color instead of the color I set for all the elements. FF doesn’t hightlight the <br> so it works fine.
I tried to override the ::selection for <br>, doesn’t work; Tried to use user-select:none;, doesn’t work either; Tried display:none;, which simply made my <br> all disappeared…
Any idea?
I think you would need read this question with all its answers.
By the way if you need to simulate this behavior in Chrome I think you can simulate a
<br/>with<span>. Something like this:EDIT:
After several tests, I concluded that to replicate the behavior in Chrome you would need a javascript that replicate this styles.
EDIT2:
To remove the pink border in the second line I make another demo (I think it’s more clear).