Should the cursor property be set in a rule with or without the :hover pseudo-class?

前端 未结 3 1939
清酒与你
清酒与你 2020-12-20 17:00

Say you, or I, have coded an HTML element...

H

...and some :hover CSS...

相关标签:
3条回答
  • 2020-12-20 17:43

    Both ways are equally good. However i would put it on the id itself as :hover does not work on ie6 or below if element is not an anchor. If you do not care about older versions of IE. Then both ways are correct.

    0 讨论(0)
  • 2020-12-20 17:47

    They are both the same, provided you always want the pointer there, reguardless of hovering.

    The :hover pseudo class will inherit cursor: pointer from its non hovered state.

    I would prefer to put it on the normal selector, rather than :hover.

    0 讨论(0)
  • 2020-12-20 17:57

    Compatibility: IE6 and below only recognize the :hover pseudo class on a elements.

    0 讨论(0)
提交回复
热议问题