Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

javascript

css

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.

like image 674
BrianP Avatar asked Oct 09 '22 02:10

BrianP


1 Answers

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

like image 163
Derek 朕會功夫 Avatar answered Oct 12 '22 21:10

Derek 朕會功夫