CSS appears different on Windows than Mac

后端 未结 3 1942
借酒劲吻你
借酒劲吻你 2021-01-24 12:17

When I view the site in Windows then most of the site, like the top text, right contact details, nav text and welcome text appear lower than they do on the mac. Mac browsers sho

3条回答
  •  遥遥无期
    2021-01-24 12:26

    The problem is the different default styles that browsers have. Neither way of displaying your page is wrong, they are just different.

    You have compensated for the default styles of one browser, which makes it look quite different in all other browsers. As long as you compensate for the default styles instead of overriding them, you will have that problem.

    For example, for the .slogan style you should set the top and bottom margin to zero, instead of using relative positioning to compensate for the default margin. You can use line-height to center the text vertically in the element, instead of moving it up or down to place it in the center.

    Example:

    .slogan{
      width: 960px;
      line-height: 30px;
      margin: 0 auto;
      color: white;
      font-size: 1.3em;
      font-family: 'Aldrich', cursive;
    }
    

提交回复
热议问题