Negative margin different result on safari than any other browser

后端 未结 3 512
走了就别回头了
走了就别回头了 2021-01-19 01:42

CSS:

dd
{
    margin: -1.2em 4em 0 1em;
}

This is the only CSS rule applied. The negative margin is pushing it more to the top on Safari th

3条回答
  •  时光说笑
    2021-01-19 02:02

    Without seeing more of your code, it's hard to determine what might be happening ... especially regard to the cascade affecting the element.

    However, try changing your ems to pixels:

    dd { margin: -12px 40px 0 10px; }
    

    Note: You may need to adjust the pixel values, but you get the idea.

    Every em value is relative to its parent's value. If you are using em's as a straight substitution for pixel values, this can cause problems.

提交回复
热议问题