Bootstrap: <a> buttons have different cursor behaviour to <button> buttons.

Created on 31 Dec 2016  路  5Comments  路  Source: twbs/bootstrap

232e86d removed .btn { cursor: pointer; }, but kept [role="button"] { cursor: pointer; }, which causes <a class="btn" role="button"> to behave differently to <button class="btn">.

/cc @mdo

css has-pr v4

Most helpful comment

Btw, should a.btn still have a cursor: pointer? If I get Buttons shouldn鈥檛 have a hand cursor correctly, it's more about the shape than the action.

All 5 comments

Hmm, yeah that's a tough one. Will noodle on it.

Btw, should a.btn still have a cursor: pointer? If I get Buttons shouldn鈥檛 have a hand cursor correctly, it's more about the shape than the action.

Btw, should a.btn still have a cursor: pointer?

if it behaves like a button (triggers a behavior, rather than acting as a link to another page/part of the current page), then in theory yes. But as some authors will apply .btn for things like calls to action that are in fact links to another page, it's a tough one to untangle one way of another...

But in general, assuming authors give the correct role="button" to links that act as buttons, then you'd probably want something like

[role="button"] { cursor: default; }

and possibly even things like role="tab"

Fixed with #21812.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iklementiev picture iklementiev  路  3Comments

cvrebert picture cvrebert  路  3Comments

tiendq picture tiendq  路  3Comments

devdelimited picture devdelimited  路  3Comments

ghost picture ghost  路  3Comments