转换:translateX使超链接不可点击

I made a carousel slider(copied the code from some codepen then made some changes) and it looks something like this. Anyway the problem is that those images have hyperlinks that work unless i make a transform on x axis..for lets say 240px the hyperlinks stops working. What i mean by that its that its unclickable. This is the structure of the html code. I made a script that adds style = "transform:translateX(-240px); to the carousel div.

预期的行为:超链接应该是可点击的。

评论
  • 妞给爷站住
    妞给爷站住 回复

    尝试发布代码而不是图像,以获得更好的答案。

    this question similar to - CSS - Transform function not working on links?

    您需要制作链接(即标签)CSS来显示块,因为转换无法在显示器上显示:inline(标签的默认值)。

  • bquos
    bquos 回复

    由于未提供css,因此z索引可能不正确(各层)。尝试这个:

    .card {
        position: /* set this to relative/absolute, depending on your preference */;
        z-index: 1;
    }