AEM Sites: Whitespace and image styling issues in custom Content Block components

This article explains how to resolve layout and image styling issues, such as unexpected whitespace and missing border radius, in published AEM Sites pages that use custom Content Block components.

Description description

Environment

Adobe Experience Manager (AEM) Sites (all versions)

Symptoms

  • Unexpected gap or whitespace appears below images in published pages.
  • Image border radius styling is missing, resulting in square corners instead of rounded corners.
  • Images or content blocks are positioned too close to adjacent content, causing layout, spacing, and alignment issues.

These issues affect the visual presentation and consistency of the published page.

Cause

These layout and styling issues are caused by the custom implementation and CSS of the Content Block component, not by out-of-the-box AEM functionality.

Resolution resolution

Follow the steps below to resolve the issue:

  1. Review the implementation of the custom Content Block component in your AEM Sites project.

  2. Inspect the associated custom CSS for the component, focusing on the following areas:

    • Ensure that CSS selectors for image elements correctly apply the intended border-radius property.
    • Check for any CSS rules that may introduce unintended margin or padding below images, causing extra whitespace.
    • Verify the spacing and alignment rules between content blocks to ensure adequate separation and alignment.
  3. Update the custom CSS as needed to:

    • Restore the desired border radius styling to images.
    • Remove or adjust any rules causing unwanted whitespace below images.
    • Correct spacing and alignment between content blocks.
  4. Republish the affected pages, and verify that the layout and styling issues are resolved.

recommendation-more-help
experience-cloud-kcs-help-kbarticles