My thought was I could perhaps use a simple animation when the span has focus to make the border blink so it appears like a cursor. Probably could have done this using an input too but as input is so opinionated I wanted to prove the approach could work on a simple element first. I know, where’s that ‘Boo Hoo’ emoji? That said, Šime pointed out in the comments that there is a draft proposal for caret-color so, maybe one day! Turns out there is no way of doing that currently with W3C HTML/CSS there is no pseudo element for the caret-style and caret-colour. However, I just pulled those pseudo elements straight out of my hat (yes, I typed something different than ‘hat’ at first). Common sense seems to suggest that you should be able to use the ‘right’ element (an input for example) and use something like :caret-color: red along with :caret-style: block in the CSS. Right, now by default, a custom caret isn’t possible. ![]() ![]() I don’t want to get into why I’m doing this, or the merits (or lack thereof) of creating a custom caret. ![]() ![]() In case you don’t know what I mean by ‘caret’, it’s essentially the cursor in an input field or other text entry area. I want to create a user input field with a different coloured caret.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |