Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

HTML & CSS scroll-snap-type & issues with page height / width

kelinho

New Coder
Hi there!

I am using Cargo to build my site and made only small adjustments to the CSS.
I implemented snap-scroll-type which finally starts working (only on the information page for now).

I am only referring to the information page where problems are visible best.

Issue:
There is something odd with the page width (and probaly height) of the page.. my head is puzzled with code.
I adjusted width/height values inside the css to make the snapping work.. there might be the issue.

- The snapping works fine, but I needed to reduce the width in the section part in order to have a proper right side padding inside the mobile page.
Its super weird and I don't know why it seems that the page is continuing to the right side... I also can not set right paddings for the page - or it wont show up.

This is just to illustrate the right side issue

The same section on the desktop version, where you see the adjustment made from the section width part.
See that the alignment of the text above should actually be with the menu below:

Trying to post the relevant code

CSS:
#toolset {
    display: none;
}

body {
  width: 100vw;
  height: 100vh;
  background-color: #fff;
  max-width: 100%;
}
 
  /* SETUP SCROLL SNAP */

.snap_container {
    width: 100vw;
    height: 85.2vh;
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    overflow-x: hidden;
}

section {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 95vw;
    height: 85.2vh;
    scroll-snap-align: start;
    }

I am not 100% sure if the "right side padding" issue comes from this part. Call me a newby in css.

Thanks for your help and any recommendations!

Kind Regards
Kerim
 
Back
Top Bottom