Javascript 我怎样才能不重复背景呢?
我不想重复javascript的图片(背景)Javascript 我怎样才能不重复背景呢?,javascript,Javascript,我不想重复javascript的图片(背景) e.target.style.backgroundImage = "url(sozai/a.jpg)"; 在本例中,a.jpg将重复显示为背景,但我不想重复 我还想改变图片的透明度 您可以设置背景重复属性,如 e.target.style.backgroundImage = "url(sozai/a.jpg)"; e.target.style.backgroundRepeat = "no-repeat"; 还是简化 e.target.style.
e.target.style.backgroundImage = "url(sozai/a.jpg)";
在本例中,a.jpg将重复显示为背景,但我不想重复
我还想改变图片的透明度 您可以设置背景重复属性,如
e.target.style.backgroundImage = "url(sozai/a.jpg)";
e.target.style.backgroundRepeat = "no-repeat";
还是简化
e.target.style.background = "url(sozai/a.jpg) no-repeat";
e.target.style.backgroundImage = "url(sozai/a.jpg)";
e.target.style.backgroundRepeat = "no-repeat";
还是简化
e.target.style.background = "url(sozai/a.jpg) no-repeat";
e.target.style.backgroundRepeat = "no-repeat";
为了透明度
e.target.style.opacity = "0.7";
不再重复
e.target.style.backgroundRepeat = "no-repeat";
为了透明度
e.target.style.opacity = "0.7";
e、 target.style.backgroundRepeat=“无重复”;e、 target.style.backgroundRepeat=“无重复”;更改不透明度也会影响元素内部的所有内容,而不仅仅是背景。但是可以使用伪元素专门针对背景图像的不透明度。请参见如何实现此目的。更改不透明度也会影响元素内部的所有内容,而不仅仅是背景。但是可以使用伪元素专门针对背景图像的不透明度。请参见如何实现这一点。