Franklin Yu
Franklin Yu

Reputation: 9958

Why the “auto” value of “cursor” gives my anchor a text-like cursor

Documentation of auto value says

The UA will determine the cursor to display based on the current context. E.g., equivalent to text when hovering text.

a {
  cursor: auto;
}
<a href="https://www.example.com">hover your mouse over me</a>  

Why the above style-sheet gives me an I-beam for a link? I expected a pointer-like cursor because that’s for an anchor tag right?

Upvotes: 1

Views: 507

Answers (1)

Franklin Yu
Franklin Yu

Reputation: 9958

That description is based on CSS Level 2 Revision 1 (a.k.a. CSS 2.1). In CSS Basic User Interface Module Level 3 (a.k.a. CSS3 UI) the description became:

The UA determines the cursor to display based on the current context, specifically: auto behaves as text over selectable text or editable elements, and default otherwise.

This is more explicit. Note that CSS3 UI is already a recommendation (the term for “standard” in web industry).

Upvotes: 2

Related Questions