use abbreviated hex code - zilongxuan001/LearnFreecode GitHub Wiki
可以使用简写,将6个十六进制数字缩写为3个数字,不过可选的颜色也就变成了4000种。
#0FF
青色(Cyan)
#0F0
绿色
#F00
红色
#F0F
紫红色(Fuchsia)
示例如下
<style>
.red-text {
color: #F00;
}
.fuchsia-text {
color: #F0F;
}
.cyan-text {
color: #0FF;
}
.green-text {
color: #0F0;
}
</style>
<h1 class="red-text">I am red!</h1>
<h1 class="fuchsia-text">I am fuchsia!</h1>
<h1 class="cyan-text">I am cyan!</h1>
<h1 class="green-text">I am green!</h1>
浏览器显示如下
Basic CSS: Use Abbreviated Hex Code | Learn freeCodeCamp
2018-10-7 16:57:05