Color change onhover?

2019-09-21 16:48发布

问题:

How do you make a simple square that when you hover (or mouseover) the whole thing changes color?

Thanks for the help!

回答1:

Here it is:

<style type="text/css">
div.test
{
width: 115px;
height: 115px;
background-color: blue;
}
div.test:hover
{
background-color: red;
}
</style>
<div class="test"></div>


标签: html hover