我看到有些应用程序即使包含了黑色图标,也会使用CSS将图标转换为不同的颜色。但我似乎无法重复这个过程。
这是我的back.css文件:
.dashboard-buttons a {
width: 80px;
height: 80px;
border: 1px solid #ccc;
margin: 0px 5px;
display:inline-block;
border-radius: 10px;
background:white;
text-decoration:none;
-moz-box-shadow: inset 0 0 15px rgba(0,0,0, 0.25);
-webkit-box-shadow: inset 0 0 15px rgba(0,0,0, 0.25);
}
.dashboard-buttons a:hover {
text-decoration:underline;
}
.dashboard-buttons span,
.dashboard-buttons img {
display:inline;
font-size: 12px;
font-weight:bold;
}
.dashboard-buttons .sessions img {
background-color:#C60;
}
.dashboard-buttons .sessions img {
-webkit-mask-image:url(mobile/images/calendar2.png)
}
而 HTML 代码看起来像这样:
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" href="back.css" />
<title>West</title>
</head>
<body>
<div class="dashboard-buttons">
<a href="sessions.php" class="sessions">
<img src="mobile/images/calendar2.png">
<span>Sessions</span>
</a>
</div>
</body>
</html>
但是在我的Chrome浏览器中无法工作。 我错过了什么吗?
附加说明:我只需要支持现代Webkit浏览器。 不需要担心IE或其他任何浏览器。
我在这里发布了我的代码http://jsfiddle.net/ZnbF3/。 这是我第一次使用jsfiddle,希望它可以工作?如果不行,只需复制我已经发布的html文件和css文件。 我已将calendar2.png附加到此问题。
url
中。 - Denys Séguret