Safari can sometimes render Webflow elements incorrectly due to lack of support for certain CSS properties or inconsistent layout behaviors. Here's how you can work around or fix common bugs specific to Safari.
position: sticky
not workingvh
unit bugs on mobile SafariYou can target Safari using a known media query hack:
Add this custom code in Page Settings → Custom Code → Inside <style>
tags in the <head>
section:
```css
@media not all and (min-resolution:.001dpcm) {
@supports (-webkit-appearance:none) {
/_ Safari-only styles /
.your-class {
/ e.g., override a position or fix flexbox issue _/
}
}
}
```
Replace .your-class
with the specific class you're targeting.
navigator.userAgent
) if needed.backdrop-filter
, transform: translateZ(0)
), override or remove them specifically for Safari using the Safari-only media query shown above.If CSS hacks aren’t sufficient, detect Safari with JavaScript and apply class-based changes:
```javascript
if (navigator.userAgent.indexOf('Safari') !== -1 && navigator.userAgent.indexOf('Chrome') === -1) {
document.body.classList.add('safari');
}
```
Then in your custom code, you can write:
```css
body.safari .your-class {
/_ Safari-specific override _/
}
```
Add this script in Page Settings → Footer Code (before </body>
).
To fix Safari-specific bugs in Webflow, use CSS media query and feature detection hacks to isolate styles for Safari. For more complex issues, fall back to JavaScript-based user agent detection and apply class selectors. Always test directly in Safari to confirm fixes.