Home > Software design >  How to change button font on hover on CSS?
How to change button font on hover on CSS?

Time:08-15

I'm new with CSS. Is it possible to change the font type of a button when hovering? I have found a lot of posts considering the change of color, but not the change of font. Thanks!

CodePudding user response:

You have to make use of button:hover.

button {
  font-family: "Times New Roman", Times, serif;
}

button:hover {
  font-family: Arial, Helvetica, sans-serif;
}
<button>Hover on me to change font !</button>

CodePudding user response:

You can change the button font on hover by using the ":hover" pseudo-class in CSS.

For example:

button:hover { font-family: sans-serif; }

CodePudding user response:

yes there is a way if you add font-family: then the font style you want to use to your button:hover it will display the different font when hovered over button button code in vscodebutton when hover active

  • Related