Zaeo Zaeo - 1 year ago 68
CSS Question

Background in safari is distorted

I'm working on a new client's website, and everything looks good in every browser except safari. The Problem: The Background image is not responding to the css in place in safari(The 5px size).

.et_pb_section_0 { /* The background CSS */
background: url( 5px;

I have been unable to find any definitive information regarding this issue.

Because Safari shares webkit functionality with chrome, attempts to resolve this issue via that resulted in the site breaking in chrome. Is there a way to target safari specifically?

Answer Source

In the CSS background shorthand property, the background-position comes before background-size. This makes your 5px correspond to background-position, not background-size.

To fix this, add a background-position and separate it from background-size with a slash:

.et_pb_section_0 {
    background: url("") 0 / 5px;

Alternatively, define background-image and background-size separately:

.et_pb_section_0 {
    background-image: url("");
    background-size: 5px;