0

html {
  height: 100%;
}

body {
  height: 100%;
  background-color: var(--main-bg2-color);
}

.wrapper {
  position: relative;
  width: 100%;
  height: auto;
  margin-top: 55.6px !important;
  display: grid;
  grid-template-columns: 17% 50% 30%;
  column-gap: 15px;
}

.left-side {
  background-color: var(--main-bg2-color);
  color: var(--main-text-color);
  height: 100%;
  padding-top: 41px;
  padding-left: 0;
  position: sticky;
  top: 55px;
}

.middle-side {
  padding-top: 40px;
  background-color: var(--main-bg2-color);
  color: white;
  height: auto;
}

.right-side {
  padding-top: 40px;
  padding-left: 0;
  background-color: var(--main-bg2-color);
  height: auto;
  position: sticky;
  top: 55px;
}
<nav>
</nav>

<div class="container">
      <div class="wrapper">
        <div class="left-side">
        </div>
        <div class="middle-side">
        </div> 
        <div class="right-side">
        </div>
      </div>
    </div>
</div>

<footer>
</footer>

I want the left side class div and right side class div to be sticky and middle content should be scrollable while scrolling down so I have used position sticky to left side class and right side class. But the position sticky is not working.

cloned
  • 6,346
  • 4
  • 26
  • 38
ronak patel
  • 378
  • 1
  • 8
  • 24

1 Answers1

-3

add this

  // chrome
  position: -webkit-sticky;

  // firefox
  position: -moz-sticky;

  // IE
  position: -ms-sticky;
madi.wd
  • 148
  • 1
  • 3