- Решено
- Архивировано
Unexpected cursor shown inside focused div
I recently noticed a number of places on websites where a cursor would appear in a place where no keyboard input is accepted. I've narrowed it down to this: Define a div… (читать ещё)
I recently noticed a number of places on websites where a cursor would appear in a place where no keyboard input is accepted. I've narrowed it down to this:
Define a div like this: <div tabIndex="1"></div>
Style it like so: div {
width: 200px; height: 100px; border: solid 2px red;
} div:focus {
background-color: lightblue;
}
Click inside the div. It turns blue to show it has focus, but it also shows a cursor at the top-left.
This does not seem to happen when you use <div tabIndex="1" /> and it also doesn't happen in other browsers.