Skip to main content

CSS-based push down Banner

Fix layout conflicts caused by Banners on complex pages

Written by Chameleon Team

The CSS-based push down is an alternative to the default pushdown Banner, built for cases where the standard approach causes layout conflicts with other elements on your page.

Instead of using JavaScript to push page content down at runtime, it uses CSS variables and selectors to handle the layout shift natively in the browser without competing with your existing layout logic.


How does this differ from the default push down position

Instead of using JavaScript to push page content down at runtime, this type uses CSS variables and selectors to handle the layout shift natively in the browser.

This ensures that all other elements on the page (e.g., dropdowns, sticky elements) reposition cleanly when the Banner displays, as there's no competing layout manipulation at runtime.

Key differences

Current, JS-based

New, CSS-based

Generic, one-size fits all.

Specific to each website.

Pushes things down / up at runtime using JS.

Pre-defined CSS classes/selectors, evaluated by CSSDom browser engine.

Proactively detects page changes, calculates positioning in runtime for elements individually.

No proactive updates. Translates the body tag and anything static, adjusts positioning accordingly.

Cannot be adjusted to specific customer cases, since it's a generalist solution.

Needs specific CSS to handle runtime-calculated positioning (e.g. tooltips or modals injected using react portal, etc.).

Although optimized, it does real-time calculations.

Better performance, since no real-time calculations are being made.

πŸ‘‰ The CSS push down position is the fix if you see layout drift or conflicts with the default push down position.


How to use CSS push down Banners

Once this is enabled on your account, you will find the Push down (CSS) option in the Builder in the Position panel.
​


Open the Banner you want to configure

  1. Go to Position

  2. Pick Push down (CSS)

  3. Preview to confirm that other UI elements reposition correctly

  4. Publish

πŸ‘‰ We're actively refining the CSS positioning. If something doesn't behave as expected, let us know.

Did this answer your question?