Reputation: 2443
when the mouse hovers on the text. the white rounded corner appears as the text's background. is there a way to get that by css? and how to slice the rounded corner background. thank you
Upvotes: 3
Views: 57
Reputation: 18242
The classic technique is CSS Sliding Doors, but now you can use some CSS 3 magic to get the same effect.
a {
color: #fff;
}
a:hover {
color: #222;
background: #fff;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
Here's a working example at JSBin: http://jsbin.com/acizer
Upvotes: 1
Reputation: 4238
You can perform rounded-corner css styling by applying the following attributes:
.rounded-corners :hover{
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
-khtml-border-radius: 20px;
border-radius: 20px;
}
Upvotes: 3
Reputation: 966
Yes, you'll want to use the :hover selector to make the background appear and disappear, and the border-radius, -moz-border-radius and -webkit-border-radius attributes to make the corners rounded.
Upvotes: 0