我有一个图像,当我将鼠标悬停在图像上时,我想这样做,在图像上会出现一些不透明的背景色。到目前为止,这是我的代码:
var result = this.cache.AddOrUpdate(
key,
(key1) =>
{
if (!this.IsFull())
{
return new List<MyObject> { value };
}
what to return here??
},
(key1, value1) =>
{
value1.Add(value);
return value1;
});
.serviceImg {
border-radius: 50%;
width: 100%;
border: 5px solid gray;
}
.img_wrap:hover .serviceImg {
background-color: rgba(9, 112, 196, 0.7);
}
它可以工作,但是问题是背景出现在图像下方而不是图像上方,我不知道该如何解决。