灯箱的怪异行为

我刚刚尝试了@ongtiffany在CSS code上写的codepen.io关于灯箱的信息。 代码很棒,但是如果我在独立测试中使用它(如下)

   <body>
        <a class="lightbox" href="#first">
            <img src="https://drive.google.com/uc?export=view&id=1cKXuGQzX3t65NoYEKfuI4wBHwxUM9wjH"/>
        </a>
        <div class="lightbox-target" id="first">
            <img src="https://drive.google.com/uc?export=view&id=1cKXuGQzX3t65NoYEKfuI4wBHwxUM9wjH"/>
            <a class="lightbox-close" href="#"></a>
        </div>
        <a class="lightbox" href="#second">
            <img src="https://drive.google.com/uc?export=view&id=1kLe9YXiM2XdgwKkATwkhfk6kzdnKIefi"/>
        </a>
        <div class="lightbox-target" id="second">
            <img src="https://drive.google.com/uc?export=view&id=1kLe9YXiM2XdgwKkATwkhfk6kzdnKIefi"/>
            <a class="lightbox-close" href="#"></a>
        </div>
    </body>
</html>

在两张图片之间给我留下了一个奇怪的“ _”符号。

可以看到吗?有什么消除建议吗?

还有一个问题?通过按“ ESC”键关闭窗口的方法是什么?

www2281100 回答:灯箱的怪异行为

尝试一下

a.lightbox{
  text-decoration:none;
}

输出

enter image description here

本文链接:https://www.f2er.com/3141463.html

大家都在问