DEV Community

Faisal Ahmed
Faisal Ahmed

Posted on

Positionally Center, when use position like fixed, center the container

.product-scroll-area {
  display: block;
  position: fixed;
  bottom: 20px;
  width: 70%;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s linear;
  z-index: 300;

  /* Changes to center horizontally */
  left: 50%;
  transform: translateX(-50%);
}

Enter fullscreen mode Exit fullscreen mode

Top comments (0)