<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
#div1{
width:100px;
height: 100px;
background: red;
opacity: 0.5;
}
#div2{
width:100px ;
height: 100px;
background: rgba(255,0,0,0.5);
}
</style>
</head>
<body>
<div id="div1">我是歌谣</div>
<p>我是顾顾</p>
<div id="div2">我是歌谣</div>
</body>
</html>
运行结果
来源:CSDN
作者:你知道歌谣吗?
链接:https://blog.csdn.net/weixin_43392489/article/details/103465731