大家好,我的代码有问题,只有当我删除 Firefox 和 IE 中的 transform: rotate() 而在 Chrome 中运行良好时,背景附件才能正常工作。
这是我的 HTML
<div class="para">
</div>
这是我的CSS
.para{
z-index: -100;
height: 160vh;
width: 100%;
margin-top: -40rem;
background: url("back1.jpg") no-repeat center;
background-size: cover;
background-attachment: fixed;
-webkit-clip-path: polygon(0 22%, 100% 0, 100% 79%, 0% 100%);
clip-path: polygon(0 22%, 100% -800px, 100% 60%, 0% 100%);
transform: rotate(10deg);
}
因此,为了清楚,当我删除 translate 属性时,我添加它时它只能在 chrome 中工作。