BrianP
BrianP

Reputation: 77

:hover { cursor: pointer } on circle created via borderradius will make it a pointer even outside the circle

I've created a circle button using border-radius. My issue is that when using the following code: button:hover {cursor: pointer} the cursor will be a pointer even outside the circle ( but inside the "rectangular div"). Im pretty sure I need javascript to solve this (althou I've included the CSS tag in case im wrong), but other than that Im blank, if anyone could Point me in the right direction, it'd be great!

thanks.

Upvotes: 5

Views: 6074

Answers (1)

Derek 朕會功夫
Derek 朕會功夫

Reputation: 94359

You can use SVG for that. SVG is cross browser capable.

<svg>
    <circle cx="40" cy="40" r="24"/>
</svg>

circle:hover{
    cursor: pointer;
    background: yellow;
}

DEMO: http://jsfiddle.net/DerekL/Jpnre/
MDN: https://developer.mozilla.org/en/CSS/Getting_Started/SVG_graphics

Upvotes: 3

Related Questions