What are the HTML, CSS, and jQuery code snippets used to create full-page sections in Webflow?

TL;DR
  • Create sections using Div Blocks with unique IDs and apply a class like full-page-section.  
  • Set each section’s height to 100vh and width to 100% using CSS or Webflow’s Style Panel.  
  • Optionally, add jQuery to enable smooth scrolling between sections via anchor links.

To create full-page sections in Webflow using code, you can enhance Webflow’s native design tools with some HTML structure, CSS styling, and optional jQuery for scroll interaction. Here's how:

1. HTML Structure in Webflow

  • Use Webflow Div Blocks to represent each section of the page.
  • Assign each section a unique ID (e.g., section1section2, etc.) to allow targeting and navigation.
  • Inside the Webflow Designer:
  • Drag a Section or Div Block onto your page.
  • Set its ID in the Element Settings panel (gear icon).
  • Give it a class name like full-page-section.

2. CSS for Full-Height Sections

  • Add this custom CSS in Page Settings > Custom Code > Head section.

You can copy this directly into your custom code area (no <style> tag needed in Webflow):

Add:

  • height: 100vh sets each section to full screen height.
  • overflow: hidden ensures no extra scrollbars appear.

.full-page-section {
  height: 100vh;
  width: 100%;
  overflow: hidden;
  position: relative;
}

  • Alternatively, add these styles via the Style Panel in Webflow:
  • Set Height to 100VH.
  • Set Width to 100%.

3. jQuery for Scroll Navigation (Optional)

  • If you want smooth scroll between sections (on arrow press or click), add this script in Page Settings > Custom Code > Footer section:

Example uses anchors for nav:

$('a[href^="#"]').on('click', function(e) {
  e.preventDefault();
  let target = $(this.getAttribute('href'));
  if (target.length) {
    $('html, body').stop().animate({
      scrollTop: target.offset().top
    }, 1000);
  }
});

  • Make sure each navigation link uses the href="#section1" style to match the IDs of your sections.

4. Alternative Library Option: FullPage.js (Advanced)

  • If you want section snaps and scroll-jacking behavior, consider integrating fullPage.js manually.
  • Note: This requires more custom code and isn’t natively supported in Webflow.

Summary

To create full-page sections in Webflow:

  • Structure sections with Div Blocks and unique IDs.
  • Style them with 100vh height using CSS or Webflow’s Style Panel.
  • Enhance navigation with optional jQuery for smooth scrolling.

This combination gives you precise control over full-page layouts within Webflow.

Rate this answer

Other Webflow Questions