我没有透明图像或其他任何内容,为什么在img的左上角有水印?
<img style="display:inline-block;background-color:#000000; width: 256px; height: 256px; cursor: pointer; border: 5px solid #000000;" onClick="this.src='https://i.imgur.com/M5VkVbK.png'
this.style.width='266px';this.style.height='266px'
;this.style.cursor='default'" />
对此感到好奇。希望有人在这里会有一个答案。
那不是水印,这意味着它找不到图像。仔细检查您的URL,并确保您的开发机器可以访问该URL。
该代码似乎对我来说很好。
请注意,在单击之前,您将有一个残破的图像图标,因为该<img>
标记src
未定义。一个好的解决方法是同时使用1x1图像。我在下面的代码段中实现了此功能。
<img src="http://placehold.it/1" style="display:inline-block;background-color:#000000; width: 256px; height: 256px; cursor: pointer; border: 5px solid #000000;"
onClick="this.src='https://i.imgur.com/M5VkVbK.png'
this.style.width='266px';this.style.height='266px'
;this.style.cursor='default'"/>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句