3 ms·
Ask HN: Can you construct G2 Curves in CSS?
Does anyone know how to create G2 curves in CSS? Here's a little link demonstrating them: http://www.delcam.tv/delcam-video.asp?VideoId=77
Basically, they're perfectly smooth, rather than being simple quarter-circles like CSS's border-radius. Things such as the corners on the iPhone are supposedly constructed of them.
My math skills are a little weak to understand how these are even constructed, but I'd imagine that someone could construct them out of CSS by layering a bunch of DIVs with different border-radius properties on top of them.
Sounds ugly (from a semantic standpoint) and a little nit-picky, but with things like the introduction of the Retina Display on the iPad 3, I think we'll start seeing subtleties like this popping up in the future.
- haydenchambers 15y agowhy on earth would you try it with divs and not say canvas/svg?
- syatson 15y agoIf there is a way it's most likely not IE friendly. Maybe look at using <canvas>. http://jsfiddle.net/mBzVR/175/ http://jsfiddle.net/mBzVR/175/ Best of luck!