4.6颜色属性

58 阅读1分钟
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
	<style>
		div{
			/* 1.设置颜色关键字  */
			/* color: red; */
			/* 2.十六进制 0-f 0-9 a-f 3/4/6 */
			/* color: #ff00ff; */
			/* 3.rgb 三原色 red green blue 取值范围:0-255 */
			/* color: rgb(23, 197, 29); */
			/* 4.rgba alpha 透明度 0-1  0完全透明 1完全不透明 */
			color: rgba(47, 0, 163, 0.5);
		}
	</style>
</head>
<body>
	<div>我是一个div</div>
</body>
</html>