<div> "circle" browser consistency, border radius
As a test, I tried to create a <div> as a circle. <div> has some text inside it, but otherwise it's empty.
Then, in JavaScript, I calculate offsetWidth and offsetHeight using a maximum of two, and assign it to a variable called diameter (although realistically, the width will probably always be larger). I use diameter to assign a <div> its width, height and borderRadius. The result is something like a circle (at least in Chrome, Firefox, Opera and Safari. I have not tested IE).
Testing in Chrome, Firefox, Opera and Safari. I noticed that this behaves differently for CSS hover and JavaScript onmousedown when the cursor is outside the area of ββthe circle, but inside the area of ββthe rectangle, which would be if border-radius not set.
Here are the results when the cursor is in this place:
- Chrome:
hoverandonmousedownaffected outside the circle - Firefox:
hoverandonmousedownaffected only inside circle - Opera:
hoverandonmousedownaffected outside the circle - Safari:
hoverandonmousedownaffected outside the circle
Firefox's behavior has one that I would like to use sequentially, is there a way to make this possible?
Change If you find a solution, explain which browser you are using.
Have you tried using css hacks so that you can install certain types of css depending on the browser that the user is using. Here is a site that gives an explanation:
http://www.paulirish.com/2009/browser-specific-css-hacks/
If there is no circle violin here:
Here is the css that I used:
.circle { padding: 20px; background: red; width: 20px; border-radius: 20000px; height: 20px; }