color
background-color: rgb(0, 255, 0);
background-color: rgba(0, 255, 0, 0.5);
background-color: hsl(240, 50%, 50%);
background-color: hsla(240, 100%, 50%,0.5);
background-color: lime;
HSL函数中,第一个参数色调,取值是0-360之间,0是红色,120是绿色,240是蓝色
第二个参数是饱和度,0-100%,0% 意味着灰色,而 100% 是全彩,越来越饱和
第三个参数是亮度,0-100%,0% 意味着黑色,而 100% 是白色,越来越亮
尺寸
1.绝对单位 px mm cm in
2.相对单位
em(1em=16px,可根据网页字体大小发生变化)
rem(1rem=16px)
3.百分比
div {
/* width: 10rem;
height: 10rem; */
width: 50%;
height: 10rem;
/* height: 100%; */
/* width: 100px;
height: 100px; */
background-color: lime;
}