使用 CSS3 对图像应用色相旋转

cssweb developmentfront end technology更新于 2024/11/19 19:56:17

要使用 CSS3 对图像应用色相旋转,请使用滤镜属性的 hue-rotate 值。

示例

来看一个例子 −

<!DOCTYPE html>
<html>
<head>
<style>
img.demo {
   filter: hue-rotate(45deg);
}
</style>
</head>
<body>
<h1>Learn Spring Framework</h1>
<img src="https://www.cainiaomax.com/spring/images/spring-mini-logo.jpg" alt="Spring Framework" width="160" height="150">
<h1>Learn Spring Framework</h1>
<img class="demo" src="https://www.cainiaomax.com/spring/images/spring-mini-logo.jpg" alt="Spring Framework" width="160" height="150">
</body>
</html>

输出


相关文章


有用资源