CSS

How to Change Text Color on Hover in CSS

In this tutorial, we are going to see how to Change Text Color on Hover in CSS. You can use CSS3 transitions to easily change the color of text on mouseovers, such as a hyperlink or a paragraph.
 

CSS code:
a {
    -webkit-transition: color 2s;
    transition: color 2s;
}

a:hover {
    color: green;
}
 

HTML code:
<!DOCTYPE html>
<html>
	<head>
		<style type="text/css">
			/* Put the CSS Style Here */
		</style>
	</head>
	<body>
		<h1>Lorem <a href="#">Hover over this link</a> ipsum.</h1>
	</body>
</html>
Result

Lorem Hover over this link ipsum.

mcqMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More

Leave a Reply

Your email address will not be published. Required fields are marked *