(评论)
(comments)

原始链接: https://news.ycombinator.com/item?id=43936661

Hacker News 上的一篇讨论围绕着 CSS-Tricks 上一篇重新审视图像地图的文章展开。用户们就交互式 SVG 元素的最佳方法展开了辩论,chrismorgan 倡导使用 `` 而不是 `` 来嵌入 SVG,强调其加载速度更快,并且通过内联 SVG 可以提高内容的相关性。其他人则回忆起图像地图过去的用途,例如制作游戏,同时指出现在可以使用 Javascript 来替代。一些人指出了处理可点击区域的变通方法,例如使用 JavaScript 来缩放相对定位的锚点或基于百分比的定位。讨论还涉及浏览器特有的怪癖,例如 Safari 的选择指示闪烁,以及原文中缺乏清晰的解决方案。一位用户表达了找不到文章中描述的网站的沮丧之情,另一位用户则提到该网站尚未公开发布。总的来说,该讨论探讨了图像地图在当代 Web 开发中的演变和局限性。

相关文章
  • (评论) 2025-05-08
  • (评论) 2025-05-11
  • (评论) 2025-05-13
  • (评论) 2025-05-13
  • (评论) 2025-05-14

  • 原文
    Hacker News new | past | comments | ask | show | jobs | submit login
    Revisiting Image Maps (css-tricks.com)
    68 points by thm 20 hours ago | hide | past | favorite | 17 comments










    > My first thought was to embed anchors into the external map SVG: […]

    > This approach is problematic. Those anchors are only active when SVG is inline and don’t work with an element.

    No, this approach is fine: you just need to use instead of . is the correct choice for embedding interactive SVG.

    But you probably do want the SVG to be inline anyway, because it will load faster and is in this case actively the content of the page; which is the technical decision he ended up at, though perhaps for partly the wrong reason.

    (There’s also