adjust the background color property of text - zilongxuan001/LearnFreecode GitHub Wiki
改变文本的背景色属性
理解
除了调整整个背景色或者文本颜色来让让前景部分(foreground)容易阅读,你可以为元素增加background-color
来显示你显示的文本。这个挑战使用rgba()
而不是hex
码或者平时的rgb()
。
rgba stands for:
r-red
g=green
b=blue
a= alpha/level of opacity
RGB值的范围是0到255。
alpha的值是从1到0 。1表示完全不透明(opaque),0表示完全透明(transparent)。
rgba可以让你调整透明图,这意味着你不用完全遮盖背景。
你将使用background-color: rgba(45,45,45,0.1)
,这将产生一个暗灰色,值0.1表明这个颜色接近透明。
来源
Applied Visual Design: Adjust the background-color Property of Text | Learn freeCodeCamp
CHANGELOG
2018-10-19 11:19:54