【发布时间】:2021-06-16 13:23:15
【问题描述】:
我想要在图片顶部不可点击的叠加层
评论区的codepen链接
html:
<img src="https://www.codeproject.com/KB/GDI-plus/ImageProcessing2/img.jpg" />
css:
img{
width:100px;
height:100px;
cursor: not-allowed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0,0,0,0.5);
z-index: 1000;
}
图像顶部带有灰色不透明度
类似的东西 https://prnt.sc/10pm4zm
【问题讨论】:
-
将
cursor:not-allowed;更改为pointer-events:none; -
图像顶部带有灰色不透明度,类似于prnt.sc/10pm4zm
标签: javascript css css-selectors overlay opacity