[ASK] Fix efek css parallax scrolling untuk firefox


Status
Not open for further replies.

martinus

Beginner 2.0
kalau seperti itu coba ditambah pada syntac css sebelum position:relative; dan jika sudah di after position:absolute


HTML:
body,html{margin:0;padding:0;}

.wrapper {
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  perspective: 2px;
}

.section {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-shadow: 0 0 5px #000;
}
.parallax {
  position: relative;
  transform: translateZ(-1px) scale(1.5);
  background-size: 100%;
  z-index: -1;
}
.parallax::after {
  content: " ";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateZ(-1px) scale(1.5);
  background-size: 100%;
  z-index: -1;
}
.static {
  background: red;
}
.bg1::after {
  background-image: url('https://placekitten.com/g/900/700');
}

.bg2::after {
  background-image: url('https://placekitten.com/g/800/600');
}
 
Status
Not open for further replies.

Top