Scroll-snap and smooth scrolling
So I have this scroll snap and I am trying to use it and smooth scrolling going left and right. I have some code here but once I add scroll-snap it stops it from scrolling smoothly. Additionally how can I get rid of the scrollbar and have the same affect?
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
scroll-behavior: smooth;
}
body {
overflow-x: clip;
}
header {
width: 100%;
}
header nav {
background-color: black;
color: white;
height: 5rem;
display: flex;
align-items: center;
justify-content: center;
}
ul {
display: flex;
align-items: center;
justify-content: center;
gap: 1rem;
}
li {
list-style-type: none;
}
a {
background-color: rgb(244, 115, 3);
text-decoration: none;
color: white;
font-size: xx-large;
padding: 0.5rem;
border-radius: 10px;
transition: background-color 0.4s ease-in-out;
}
a:hover {
background-color: brown;
}
.scroll-container {
display: grid;
grid-auto-flow: column;
grid-auto-columns: 100%;
gap: 0.5rem;
overflow-x: auto;
scroll-behavior: smooth;
scroll-snap-type: x mandatory;
}
.scroll-item {
scroll-snap-align: start;
scroll-behavior: smooth;
gap: 0.5rem;
grid-template-rows: min-content;
background-color: brown;
color: white;
font-size: xx-large;
height: 85svh;
text-align: center;
}* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
scroll-behavior: smooth;
}
body {
overflow-x: clip;
}
header {
width: 100%;
}
header nav {
background-color: black;
color: white;
height: 5rem;
display: flex;
align-items: center;
justify-content: center;
}
ul {
display: flex;
align-items: center;
justify-content: center;
gap: 1rem;
}
li {
list-style-type: none;
}
a {
background-color: rgb(244, 115, 3);
text-decoration: none;
color: white;
font-size: xx-large;
padding: 0.5rem;
border-radius: 10px;
transition: background-color 0.4s ease-in-out;
}
a:hover {
background-color: brown;
}
.scroll-container {
display: grid;
grid-auto-flow: column;
grid-auto-columns: 100%;
gap: 0.5rem;
overflow-x: auto;
scroll-behavior: smooth;
scroll-snap-type: x mandatory;
}
.scroll-item {
scroll-snap-align: start;
scroll-behavior: smooth;
gap: 0.5rem;
grid-template-rows: min-content;
background-color: brown;
color: white;
font-size: xx-large;
height: 85svh;
text-align: center;
}