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
     ❯   

颜色 HEX


十六进制计算器


 
rgb(255, 0, 0)#000000
hsl(0, 0%, 0%)


R
G
B

十六进制颜色

所有浏览器都支持十六进制颜色值。

十六进制颜色由以下指定

#rrggbb

其中 rr(红色)、gg(绿色)和 bb(蓝色)是 00 到 ff 之间的十六进制整数,用于指定颜色的强度。

例如,#ff0000 显示为红色,因为红色设置为其最高值 (ff),而其他两个 (绿色和蓝色) 设置为 00。

另一个例子,#00ff00 显示为绿色,因为绿色设置为其最高值 (ff),而其他两个 (红色和蓝色) 设置为 00。

要显示黑色,请将所有颜色参数设置为 00,如下所示:#000000。

要显示白色,请将所有颜色参数设置为 ff,如下所示:#ffffff。


亲自尝试

所有浏览器都支持十六进制颜色值。

示例

<style>
div {
    background-color: #00bfff;
    color: #ffffff;
}
</style>
亲自尝试 »

×

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.