bootstrap 4, cursor doesn't change when hovering over a button but does on anchors

19,757

Here's your explanation - https://medium.com/simple-human/buttons-shouldnt-have-a-hand-cursor-b11e99ca374b

I'm not sure Bootstrap v4 adds that on anchor elements either (can't check at the moment), but what I do know for sure is that browsers add the cursor by default whenever a link has the href attribute.

LE - The stable release was launched a week ago and it now features

.btn:not(:disabled):not(.disabled) {
    cursor: pointer;
}

Announcement at https://blog.getbootstrap.com/2018/01/18/bootstrap-4/

Share:
19,757
InitLipton
Author by

InitLipton

Any fool can write code that a computer can understand. Good programmers write code that humans can understand - Martin Fowler SOreadytohelp

Updated on June 06, 2022

Comments

  • InitLipton
    InitLipton almost 2 years

    I'm using bootstrap 4 alpha, and it seems that the cursor on buttons has been removed for buttons but not anchor tags. example on the bootstrap site.

    https://v4-alpha.getbootstrap.com/components/buttons/

    In my application i have a form, with two buttons, one is to post to the form and the other is to redirec to another page. The input doesn't display the cursor but the anchor does. I know i can create a custom css class, but is there a reason why this has been removed or is it an issue with the current alpha version?

    <input type="submit" value="Sign In" class="btn btn-primary" />
    <a role="button" href="@Url.Action("Register", "Account")" class="btn btn-secondary">Register Now</a>
    
    • Rehan
      Rehan about 7 years
      Can you be clear. What do you mean by curson on buttons has been removed?
    • InitLipton
      InitLipton about 7 years
      @this.Believer when you hover over any button, the cursor changes, from a mouse pointer to the link select finger, but with bootstrap 4 this doens't occur.
  • Marc
    Marc over 6 years
    The "hand" is more or less a nemonic device meaning click here. I suppose from an ivory tower no hand on button can be the rule. When working with the masses of web users these rules do not apply all of the time or the same way. $0.02 here. The same sort of UI/UX debate raged over target="_blank"...and...still here and very important. One of the XHTML versions sorta deprecated the anchor (1.0 if memory serves). iframes have been in good favor and the opposite a few times. I remember embed, object, blink, and other tag debates. Go with what works.
  • ropeladder
    ropeladder over 6 years
    Kind of ironic that all of the Medium buttons on that post (as of 2017-10-29) change the cursor in exactly the way the post says they should not. I am of the opinion that people are so used to the cursor changing when things are clickable that not changing it signals to users that the thing is not clickable.
  • Acyra
    Acyra over 6 years
    This is especially wrong for bootstrap, because it does provide the pointer/hand over link buttons which are STYLED THE SAME as input buttons. So there is an inconsistent user experience, which is worse than the pedantic argument about over responding.
  • Kimball
    Kimball over 6 years
    The question indicates both elements already have the btn class.
  • Ravenous
    Ravenous over 6 years
    @Acyra - No longer the case. I've updated my answer.
  • Adam Marshall
    Adam Marshall almost 5 years
    Looks like it may have changed again, no cursor: pointer in my version: github.com/twbs/bootstrap/blob/master/scss/_buttons.scss
  • Adam Marshall
    Adam Marshall almost 5 years
    To clarify my comment - you get cursor: pointer for <button> and <a href> but not e.g. <span class="btn...">, which is a change from earlier versions of Bootstrap