gpt4 book ai didi

html - 有没有办法用 css 悬停图像来实现这种效果?

转载 作者:太空宇宙 更新时间:2023-11-04 03:51:38 25 4
gpt4 key购买 nike

我有一个宽度为 40 像素、高度为 40 像素的 div,里面有一个图像(或背景图像:url();),带有蓝色 facebook 图标(没有背景的蓝色“f”)。我不希望当我悬停那个 div 时,蓝色的标志变成白色,透明的背景变成蓝色,只使用一个只有一个标志的图像。这可能吗?

最佳答案

这是一个文本示例, FIDDLE

<div>f</div>

div {
width: 40px;
height: 40px;
line-height: 40px;
text-align: center;
font-family: Tahoma;
font-size: 26px;
font-weight: bold;
color: #415e9b;
cursor: pointer;
transition: all 0.3s linear;
-moz-transition: all 0.3s linear;
-webkit-transition: all 0.3s linear;
}
div:hover {
background: #415e9b;
color: #fff;
}

关于html - 有没有办法用 css 悬停图像来实现这种效果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23313684/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com