새로운 웹 사이트에서 작업하고 있으며 장래에 시차를 적용하기 위해 배경 이미지를 수정하고 싶습니다.배경 이미지 : Firefox를 제외한 모든 곳에서 수정 됨
여기 여기 내 html 코드
<div class="parallax image1"></div>
의 그리고 나의 CSS를
모두가 크롬 (58), 마이크로 소프트 에지, 인터넷 익스플로러, 오페라와 사파리에서 잘 작동
.parallax {
height: 10em;
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
-moz-background-size: cover;
-webkit-background-size: cover;
-o-background-size: cover top: 0;
left: 0;
z-index: -1;
}
.image1 {
background-image: url("https://d2wq73xazpk036.cloudfront.net/media/27FB7F0C-9885-42A6-9E0C19C35242B5AC/A7BC70EF-2E93-47DA-A355C4B22039324E/thul-6818f8f2-2711-5159-9648-cc23606b037c.jpg");
}
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure sse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<div class="parallax image1"></div>
<p>Lorem ipsum dolor sit amet, aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
미리 감사드립니다.
편집 :이 추가 기능이 작동하지 않습니다.
html {
background-attachment: fixed;}
가능한 중복 설정 [고정 된 배경 파이어 폭스 크롬에서가 아니라 작품을?] (http://stackoverflow.com/questions/6123304/fixed-background-works-in-chrome-but-not- 파이어 폭스) – codesayan
나는이 해결책을 시도했지만, 불행했다. ately는 작동하지 않는다. – Royrane
그런 다음 [mcve]를 작성하여 실제 문제를 확인할 수 있도록하십시오. – CBroe