玫玫图很美,查了帖内粒子不起作用,给你代码复制直接粘帖就行。(50% - 931px);931调左右距。 opacity: .35;调粒子透明度。- <style>
- #mydiv {
- margin: 150px 0 30px calc(50% - 931px);
- display: grid;
- place-items: center;
- width: 1850px;
- height: 950px;
- background: lightblue url('https://www.yhyhlt.com/data/attachment/forum/202606/18/162346ld09y0b5qmyq5amw.jpg') no-repeat center/cover;
- box-shadow: 3px 3px 20px #000;
- user-select: none;
- overflow: hidden;
- position: relative;
- z-index: 1;
- }
- #vid {
- position: absolute;
- width: 100%;
- height: 100%;
- object-fit: cover;
- pointer-events: none;
- mix-blend-mode: screen;
- mask: linear-gradient(to top right, red 88%, transparent 0);
- -webkit-mask: linear-gradient(to top right, red 88%, transparent 0);
- z-index: 2;
- opacity: .35;
- }
- </style>
-
- <div id="mydiv">
- <audio id="aud" src="https://www.joy127.com/url/149349.mp3" autoplay loop></audio>
- <video id="vid" src="https://img2.tukuppt.com/video_show/2629112/00/02/06/5b509c34df30f.mp4" autoplay="" loop="" muted=""></video>
- </div>
复制代码 |