-1

I'm trying to add a scroll snap so that each section snaps to the center of the page but i'm getting an unknown property error in VS code so i can't apply it to my code. Is it possible to use scroll-padding-top and scroll-snap-align somehow? do i need an extension maybe?

I've updated to the latest version 1.30.2 but still no joy, i was going to use the depreciated versions of scroll but that didn't seem sensible.

/parent container/

.container {
display: flex;
flex-flow: column nowrap;
box-sizing: border-box;
overflow-x: hidden;
scroll-snap-type: y mandatory;
scroll-padding-top: 150px;
}

/for the child elements/

section {
height: 100vh;
scroll-snap-align:start;
}

i expected the code to snap each section 150px from the top allowing for the menu but nothing happens...

  • Can you provide more information about your workflow, build process, etc.? VS Code (like any IDE) will not prevent you from saving a file just because of code linting warnings. – Jon Uleis Jan 28 '19 at 04:11
  • Its plain old VS Code out of the box, the only extension i use is emmet and one for github @JonUleis - so i made the container height the same as the section height and it worked, it still gives the error message in problems, but works all the same. Appreciate the help!! – ilovethedrama Jan 29 '19 at 00:19

1 Answers1

0

Jon Uleis was right, it did work, for some reason VS Code didn't seem to recognise the feature but it worked fine.