Reputation: 1
I have a div with round corners. When the mouse is above the div, the corners need to be right. How can I do that?
This is what I wrote so far:
<style>
#ex1
{
border: 2px outset black;
border-radius: 25px;
padding: 10px;
background-color: transparent;
text-align: center;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>
<style>
#ex1:hover
{
border-style: solid;
background-color: transparent;
text-align: center;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>
Upvotes: 0
Views: 439
Reputation: 11
You don't need to repeat the same style again for hover also. you just need to put the changes what you want to see in the hover styles.
#ex1:hover
{
border-style: solid;
border-radius: 0px;
}
Upvotes: 1
Reputation:
As Craig posted:
<style>
#ex1 {
border: 2px outset black;
border-radius: 25px;
padding: 10px;
background-color: transparent;
text-align: center;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
#ex1:hover {
border-style: solid;
border-radius: 0;
}
</style>
Upvotes: 0