在CSS3中,表示白色有不同的方法。下面将介绍其中几种常用的方法。
/* 方法一:使用十六进制数值表示 */
color: #FFFFFF;
background-color: #FFFFFF;
/* 方法二:使用rgb()函数表示 */
color: rgb(255, 255, 255);
background-color: rgb(255, 255, 255);
/* 方法三:使用rgba()函数表示,设置透明度为1 */
color: rgba(255, 255, 255, 1);
background-color: rgba(255, 255, 255, 1);
/* 方法四:使用hsl()函数表示,设置饱和度为0,亮度为100% */
color: hsl(0, 0%, 100%);
background-color: hsl(0, 0%, 100%);
/* 方法五:使用hsla()函数表示,设置饱和度为0,亮度为100%,透明度为1 */
color: hsla(0, 0%, 100%, 1);
background-color: hsla(0, 0%, 100%, 1);
以上是几种常用的方法,你可以根据实际情况选择不同的方法。希望本文对你有所帮助。