Change the background color, when a user hovers over p elements, with the class "highlight", to "pink". - HTML CSS CSS

HTML CSS examples for CSS:Quiz

Description

Change the background color, when a user hovers over p elements, with the class "highlight", to "pink".

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
p.highlight:hover {
    background-color: pink;
}
</style><!--from  w  w  w.j a va  2s .c  o  m-->
</head>
<body>

<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
<p class="highlight">This is another paragraph.</p>

</body>
</html>

Related Tutorials