The main idea is to have 4 gradients that each occupy a quarter of the element's area (one for the bottom left, one for the bottom, on of the top right and one for the top left). Then you set the background to 4 linear gradients with the same color stops (in this case we wanted the corner size to be 10px*, so it was transparent until 10px and then the color we want from 10px) except the corners that are 45deg, 135deg, 225deg and 315deg respectively.

*Actually not exactly 10px, it's the length of the hypotenuse of an isosceles right-angled triangle, which is around 14px

By using radial gradients, you can simulate rounded corners with a negative radius. Just in this case, don't put the color stops at the exact same position, since the result will be too aliased in most browsers (and kinda still is in Webkit).