Forum

Ask for help to thousands of professionals from different fields
This question has been marked as solved
Question
author_picture
| Etudiant en Génie Logiciel
| Cameroon
Standard Level
10 Points

Comment changer le texte d'un bouton lorsque la souris est sur ce bouton

Bonjour, j'aimerais bien savoir comment modifier le texte d'un bouton lorsque la souris est sur ce bouton et ensuite remettre l'ancien texte lorsqu'on enlève la souris.

Je vois cela sur certains sites web. J'aimerais savoir comment réaliser ça.

Merci d'avance.

CSS3HTML
19.1.2018 12:06
Best Answer
author_picture
| Web Developer & Security Enthusiast
| Germany
Junior Level
154 Points

Tu peux faire comme ceci:

HTML:

<button><span>TexteInitial</span></button>

 

CSS:

button:hover span {display:none}
button:hover:before {content:"TexteRemplacé"}
You have already upvoted this answer !!! You have already downvoted this answer !!! You can not vote your own answer
author_picture
| Etudiant en Génie Logiciel
| Cameroon
Standard Level
10 Points

Ok Merci @Francis. Simple et conçis. +1

You have already upvoted this answer !!! You have already downvoted this answer !!! You can not vote your own answer
× You are not logged in. Please login or sign up for free to answer this post.

Your Answer

×

You gain:

  • +15 points when your answer is marked as accepted
  • +5 points when your answer is voted up

You lose:

  • -2 points when your answer is voted down
forum_icon Related Topics