[英]Dividing a square by the diagonals and making each resulting triangle a separate button
Suppose I have a square and divide it by the diagonals resulting in four identical triangles (apart from their rotation). 假设我有一个正方形,然后将其除以对角线,得到四个相同的三角形(除了旋转)。
I have been looking into creating the triangles using image maps ( <map>
), but it seems to me it only works as expected in Internet Explorer. 我一直在研究使用图像映射(
<map>
)创建三角形,但在我看来,它只能按预期在Internet Explorer中工作。
As another possible solution, I have tried rectangular divs mimicking the triangles by placing gradually smaller rectangles towards the center of the encompassing square from all four "corners of the world". 作为另一种可能的解决方案,我尝试通过将四个“世界角落”的较小的矩形朝着所包围的正方形的中心逐渐放置来模拟矩形的div。 However, that is not an elegant solution, and really not what I'm aiming for, since I want "smooth", not jagged, triangles.
但是,这不是一个优雅的解决方案,实际上也不是我想要的目标,因为我想要“平滑”而不是锯齿状的三角形。
I would do it like this: 我会这样做:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.