CSS - 背景半透明

就一句话

background: rgba(0, 0, 0, .2);

	body {
		background-color: pink;
	}
	div {
		width: 200px;
		height: 200px;
		/*background-color: #000;*/
		color: #fff;
		background: rgba(0, 0, 0, .2); /* red  green blue  alpha  0~1  */
	}
	</style>
</head>
<body>
	<div>
		我是文字内容
	</div>
</body>
posted @ 2018-05-07 19:33  Rocin  阅读(2721)  评论(0)    收藏  举报