What could be causing the image in my Webflow site to glitch out and lower itself when I set the section height to 60% of viewport height and the image and div to 100% parent height?

Published on
September 22, 2023

There can be several reasons why the image in your Webflow site is glitching out and lowering itself when you set the section height to 60% of the viewport height and the image and div to 100% parent height. Here are a few potential causes and solutions:

  1. CSS Box Sizing: By default, the box-sizing property in CSS is set to content-box, which means the height of an element does not include padding and borders. If you have added padding or borders to your section, image, or div, it might be causing the glitch. To fix this, you can change the box-sizing property to border-box for the affected elements. This will make the height calculation include the padding and borders.

    ```css
    .your-section-class,
    .your-image-class,
    .your-div-class {
    box-sizing: border-box;
    }
    ```

  2. Overflow Issues: If the image or div inside the section is larger than the section itself, it can cause overflow issues. One possible solution is to set the overflow property of the section to hidden. This will hide any content that exceeds the section's dimensions.

    ```css
    .your-section-class {
    overflow: hidden;
    }
    ```

  3. Positioning: The positioning of the image and div can also affect their height calculations. Make sure that the position of the elements is set to relative or static, and not absolute. Absolute positioning can lead to incorrect height calculations and cause the glitching effect.

  4. Image Size: If the image itself is too large or has a large file size, it may take longer to load and cause glitches during the rendering process. Optimize your images for web use by reducing their file size without compromising their quality. You can use online image compression tools or image editing software to achieve this.

  5. Browser Compatibility: Different browsers might interpret CSS rules differently, which can lead to rendering issues. Test your website on various browsers, such as Chrome, Firefox, Safari, and Edge, to ensure cross-browser compatibility. If the glitch only occurs on a specific browser, try finding browser-specific CSS workarounds or seek help from the Webflow community.

These are some possible causes for image glitches when setting section height in Webflow. By implementing the suggested solutions, you should be able to troubleshoot the issue and achieve the desired result.

Additional questions:

  1. How to fix image glitch issues in Webflow?
  2. What is the impact of CSS box sizing on element heights in Webflow?
  3. Why does the image lower itself when setting section height in Webflow?