Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

W3.CSS 效果


普通

w3-opacity

w3-grayscale-max

w3-sepia-max


W3.CSS 效果类

W3.CSS 提供以下效果类

定义
w3-opacity 为元素添加透明度 (opacity: 0.6)
w3-opacity-min 为元素添加透明度 (opacity: 0.75)
w3-opacity-max 为元素添加透明度 (opacity: 0.25)
w3-grayscale 为元素添加灰度效果 (grayscale: 75%)
w3-grayscale-min 为元素添加灰度效果 (grayscale: 50%)
w3-grayscale-max 为元素添加灰度效果 (grayscale: 100%)
w3-sepia 为元素添加棕褐色效果 (sepia: 75%)
w3-sepia-min 为元素添加棕褐色效果 (sepia: 50%)
w3-sepia-max 为元素添加棕褐色效果 (sepia: 100%)
w3-hover-opacity 鼠标悬停时为元素添加透明度 (opacity: 0.6)
w3-hover-grayscale 鼠标悬停时为元素添加灰度效果 (grayscale: 100%)
w3-hover-sepia 鼠标悬停时为元素添加棕褐色效果

透明度

w3-opacity 类为元素添加透明度

普通

w3-opacity-min

w3-opacity

w3-opacity-max

示例

<img src="image.jpg" class="w3-opacity-min">
<img src="image.jpg" class="w3-opacity">
<img src="image.jpg" class="w3-opacity-max">
亲自尝试 »


灰度

w3-grayscale 类为元素添加灰度效果

普通

w3-grayscale-min

w3-grayscale

w3-grayscale-max

示例

<img src="image.jpg" class="w3-grayscale-min">
<img src="image.jpg" class="w3-grayscale">
<img src="image.jpg" class="w3-grayscale-max">
亲自尝试 »

注意: w3-grayscale 类在 IE 11 及更早版本中不支持。


棕褐色

w3-sepia 类为元素添加棕褐色效果

普通

w3-sepia-min

w3-sepia

w3-sepia-max

示例

<img src="image.jpg" class="w3-sepia-min">
<img src="image.jpg" class="w3-sepia">
<img src="image.jpg" class="w3-sepia-max">
亲自尝试 »

注意: w3-sepia 类在 IE 11 及更早版本中不支持。


悬停效果

您也可以在鼠标悬停/悬停时添加特殊效果。

Norway

w3-hover-opacity

Norway

w3-hover-grayscale

Norway

w3-hover-sepia

示例

<img src="image.jpg" class="w3-hover-opacity">
<img src="image.jpg" class="w3-hover-grayscale">
<img src="image.jpg" class="w3-hover-sepia">
亲自尝试 »

悬停透明度颜色

您也可以将任何 w3-hover-color 类与 w3-hover-opacity 类结合使用,以在鼠标悬停时创建略微“浅色”的背景颜色

w3-hover-red

w3-hover-red 与 w3-hover-opacity

示例

<div class="w3-border w3-hover-opacity w3-hover-red">
  <p>w3-hover-red 与 w3-hover-opacity</p>
</div>
亲自尝试 »

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
[email protected]

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
[email protected]

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.