Using only CSS, can a quad with an internal angle of more than 180 degrees be created by controlling one rectangle? I know that an arbitrary convex quadrilateral can be created from a standard rectangle using CSS3 transforms.
I managed to create concave polygons using several rectangles in several ways (sometimes using overflow hiding); some combination:
- Adjacent rectangles. This is a problem because visual discrepancies occur at the seams due to smoothing, which is more apparent with a high contrast background. The effect can be especially bad when used in combination with a rotation (other than a βgoodβ rotation, for example, 45 degrees). Rectangles also have a crazy tendency to be strangely aligned at different zoom levels.
- Overlapping rectangles, so the quadrangle consists of a union of rectangles (the color of each rectangle is the color of the quadrangle). This is a problem when the color of the quad uses the alpha channel, because the overlap area looks darker.
- Overlapping rectangles, due to which the quadrangle consists of the difference of the rectangles (the color of at least one rectangle is the background color). This is a problem when modeling a shadow by drawing the same shape with an offset, because the overlapping foreground area βerasesβ any shadow below it.
[EDIT] An example of a concave quadrangle (a kind of Star Trek symbol) using # 1 and # 3 above can be seen here .
I would like to have a concave quadrangle with a simulated shadow insert (dark foreground color with alpha channel, light shadow color with alpha channel), so # 2 and # 3 above are problematic. At the moment, the real shadow is out of the question; I did not have very good experience with the shadows of the modified elements.
So, any opportunity to do this by manipulating one rectangle? Or is there another way that I have not considered?
[EDIT]
I think this is possible to a limited extent, but it's kind of a cheat: use a one-character text whose glyph is already a concave quadrangle in some fairly safe font (e.g. U + 27A4, black right arrow in Arial Unicode), then convert the crap from him. However, this will have problems aligning between browsers with other page elements.
source share