防止图像在浏览时移动(用鼠标)

Prevent images from moving (with a mouse) while browsing

当我完成页面时。当它完成时。我想以某种方式锁定图像(例如 header 徽标层 - 尝试一下:http://www.lipanska.cz/ move with the header text EWITA). On the other side at https://www.google.com 徽标已锁定,我不能随它移动。

我怎样才能锁定它们? 非常感谢您的宝贵时间!

这是因为 Google 使用带有 background-imagediv 而另一个页面使用的是 img 标签。后者使它可以用鼠标光标拖动。 您还可以防止使用此处讨论的任何标签进行拖动: Disable dragging an image from an HTML page

使用背景图片。

演示:

div{
    background:url(http://lorempixel.com/100/100);
    height:100px;
    width:100px;
}
<div></div>
<img src="http://lorempixel.com/100/100"></img>

您不能移动第一张图片,但可以移动第二张图片。