• Hi all,

    I’m trying to work on a client project and she has requested the ability for css scroll snapping. I usually use elementor to build some of my pages and as such am not super fluent in HTML or CSS. I’ve tried watching some videos and it makes sense when I can adjust the HTML to match the CSS, but I’m not sure how to do this in wordpress. Can anyone give some guidance about this?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • WordPress provides ways to use the exact HTML you want, with the Classic editor, or with the Classic block or the Custom HTML block.
    If you use a plugin like Elementor, you should ask in the plugin’s support forum. I would think you could use Elementor to create the HTML, and if you need to make changes, then on the preview page use View Source so you can copy the HTML to a Custom HTML block.
    But you should be able to adjust the CSS to whatever the HTML is, since presentation should be separate from content.

    Thread Starter rkashey

    (@rkashey)

    I understand. I guess what I’m asking is that when using custom css, does the program understand the css command “scroll-snap-type: y mandatory;”?

    When I put in my CSS, it seems to accept everything but that command.

    I don’t know what you mean by “does the program understand the css command”.
    Are you asking about the Elementor code? Or WordPress? Or the syntax checker for the Custom CSS textarea? Or the theme’s CSS affecting it? Or the browser rendering the page?
    There could be any number of things interfering with you getting the result you want. You have to be more specific as to what you tried and what error you got or what result you didn’t expect.
    If this is a CSS question, it’s not a WordPress question, and you should ask somewhere else. But if it’s about the syntax checking WP does or how to use the editor, that’s for here.

    Thread Starter rkashey

    (@rkashey)

    So I’ve done research on the correct CSS coding so that’s not the issue. What I’m referring to is in wordpress, where you can add additional custom CSS under the “customize” tab of the website, it isn’t accepting a few of the css commands that I’m putting in. It’s accepting about 95% of it, but the syntax checking won’t recognize the “scroll-snap-type” input. I’ve watched youtube videos of how this works and have seen that the code isn’t the problem.

    Heres an example of what I’m trying to do: CSS Scroll Snapping

    The gentleman in the video is hand coding the site, but the css should work the same when I input an HTML field in wordpress and then attempt to add CSS to it.

    Does this make more sense? Sorry if I’m struggling to describe this properly.

    OK, so the problem is with the syntax checking of the CSS. WordPress uses CodeMirror for that, and it’s whatever version is bundled with that release of WP. The CSS definitions aren’t necessarily the latest and greatest, so it can show syntax errors for newer CSS that hasn’t been added to CodeMirror yet.
    The solution is for you to go to your User profile page and disable the syntax checking. Then you can save whatever you want.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘CSS Scroll Snapping’ is closed to new replies.