gpt4 book ai didi

css: 十六进制色值和简写的十六进制色值有区别吗?

转载 作者:行者123 更新时间:2023-11-28 09:04:42 24 4
gpt4 key购买 nike

CSS:

h1 {color:#000;}

html:

<h1>This is heading 1</h1>

问题:

color:#000;(简写为十六进制颜色值)和color:#000000(十六进制颜色值)有区别吗?

最佳答案

完全没有区别。根据 the CSS Color Module spec :

The three-digit RGB notation (#rgb) is converted into six-digit form (#rrggbb) by replicating digits, not by adding zeros. For example, #fb0 expands to #ffbb00. This ensures that white (#ffffff) can be specified with the short notation (#fff)...

关于css: 十六进制色值和简写的十六进制色值有区别吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18782798/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com