🔬 Confirmed🔴 Advanced⏱ 30 Minutes✓ Observation from Experience
The symptom A scroll-to-top button bundled with a WordPress FSE theme (fotawp) overlapped a fixed-position widget added to the footer. Attempts to move the scroll button using CSS `left`, `right`, `bottom`, and `z-index` overrides in Appearance → Additional CSS had no effect, even with `!important`. Adding CSS directly to the block’s Additional CSS field in the block settings panel also had no effect.
Initial assumption The assumption was that a higher-specificity CSS rule or z-index conflict was overriding the custom styles.
Investigation The scroll-to-top button visible in the WordPress block editor is not the element that appears on the live page. The theme’s JavaScript reads the block as a configuration source and injects its own floating element programmatically, with position and coordinates hardcoded in the JS. This injected element does not inherit block-level CSS or Additional CSS styles — it is created entirely outside the WordPress style cascade.
What to check When CSS overrides on a scroll-to-top or floating button have no effect:
1. Inspect the element on the live page — check if it matches the block in the editor or is a separate DOM element. 2. Check for inline styles applied directly by JavaScript (visible as `style=”…”` on the element in the inspector). 3. Look for a theme JS file that creates or positions the button dynamically. 4. Check whether the theme has a Customizer option for scroll button position — some themes expose this instead of relying on CSS.
Resolution Since the button’s position could not be overridden via CSS, the conflict was resolved by moving the new widget to the opposite side of the screen (bottom-left instead of bottom-right), eliminating the overlap entirely without needing to touch the theme’s scroll button behavior.
Troubleshooting lesson CSS overrides cannot reliably control elements whose position is set by JavaScript after page load, especially for theme-bundled UI components. When a fixed-position element resists CSS repositioning, inspect whether it is a real DOM element controlled by CSS or a JS-injected element with inline styles. Moving your own element is faster and more reliable than fighting a theme’s JS.