Reputation:
I have this HTML code:
<div class="authTabs">
<div class="h2">Login</div>
<div class="h2">Register</div>
</div>
I am using CSS. Can someone tell me how I can make it so that my cursor changes to a finger pointing and my background color changes when the Login or Register DIVs are hovered over?
Upvotes: 3
Views: 10423
Reputation: 2330
<style>
.h2{
backgorund-color : black;
cursor: pointer
}
.h2:hover{
backgorund-color : blue;
cursor: pointer
}
</style>
Upvotes: 1
Reputation: 23816
See DEMO
.authTabs {
cursor: pointer;
}
.h2:hover {
background-color: red;
}
Upvotes: 5
Reputation: 1976
Add this to your css definitions:
.h2:hover {
cursor: pointer;
background-color: red;
}
Upvotes: 1
Reputation: 22964
.clsName:hover
{
cursor: pointer;
background-color: red; // required color
}
.authTabs div:nth-of-type(1)
{
cursor: pointer;
background-color: red; // required color
}
.authTabs div:nth-of-type(1)
{
cursor: pointer;
background-color: red; // required color
}
Upvotes: 0