如何将id添加到背景图像

问题描述 投票:1回答:1

我想要制作这个标签

<img id="image" class='img' src="adventure.jpg" height="80%" width="70%"> 

对于背景图像,唯一的问题是背景图像被滤镜改变,例如不透明度等。所以我需要图像的id,因为在js中使用了图像。

var img = document.getElementById('image');
javascript html background-image
1个回答
2
投票

当您可以从应用背景图像的元素的id控制所有内容时,为什么需要背景图像的ID。

© www.soinside.com 2019 - 2024. All rights reserved.