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
     ❯   

颜色 HWB


HWB(色相、白度、黑度)是 CSS4 的建议标准。


HWB 计算器


 
rgb(255, 0, 0)
#ff0000
hsl(0, 100%, 50%)


H
W
B

HTML 支持

HWB 在 HTML 中尚不支持(尚未),但它被建议作为 CSS4 中的新标准。

在等待 CSS4 的同时,您可以包含 W3Schools 的颜色库,并将 HWB 作为 HTML 属性使用,如下所示

示例

<div data-w3-color="hwb(60, 50%, 0)">

<p>伦敦是英格兰的首都。
它是英国人口最多的城市,
其都会区拥有超过 1300 万人口。</p>

</div>

<script src="/lib/w3color.js"></script>
亲自尝试 »

W3Schools 颜色库

上面示例中使用的 JavaScript 库可以从以下网址下载

https://w3schools.org.cn/lib/w3color.js


×

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.