我标头的徽标正在Safari中扩展

时间:2019-09-12 15:06:29

标签: css

我的网站可以在计算机和Android智能手机上完美运行,但是当我在主页上的Apple智能手机中打开网站时,我的徽标在水平方向上几乎占据了标题的全部宽度,而汉堡菜单上没有任何空间(.toggle in我的代码)。

我进行了搜索,发现在野生动物园中使用flexbox时,我们会出现一些显示问题,因为它使用的是旧前缀,因此我尝试实现它们,但没有任何改变。

.header {
  background-color: rgb(235, 223, 201);
  z-index: 100;
  top: 0px;
  margin: 0 auto;
  max-height: 5rem;
  position: fixed;
  border-bottom-style: double;
  display: -webkit-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  justify-content: space-between;
  width: 100%
}

@media only screen and (max-width: 1210px) {
  .logo {
    display: -webkit-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    flex: 1;
    width: calc(100% - 50px)
  }
  .menu-one {
    display: -webkit-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    justify-content: space-between;
    width: 100%
  }
  .toggle {
    display: block;
    padding-top: 1.5rem;
    transform: translate(-10px);
    cursor: pointer;
  }
  .toggle span {
    position: relative;
    width: 36px;
    height: 4px;
    display: block;
    background-color: black;
    margin-bottom: 8px;
    transition: 0.5s;
  }
}
<div class="header">
  <div class="menu-one">
    <div class="logo">
      <img src="">
      <div class="lettering">
        <h6><span class="bolder">F</span>ÁTIMA<span class="bolder">C</span>RISTÓVÃO <span class="smaller">by KELLER WILLIAMS</span></h6>
      </div>
    </div>
    <div class="toggle">
      <span></span>
      <span></span>
      <span></span>
    </div>
  </div>
  <ul id="menu-two" class="hide">
    <li class="item">
      <a href="./index.html">Home</a>
    </li>
    <li class="item" id="proj">
      <a href="#projects">Projects</a>
    </li>
    <li class="options">
      <a href="./Atower.html">A-Tower</a>
    </li>
    <li class="options">
      <a href="./muda.html">Muda</a>
    </li>
    <li class="item">
      <a href="#About-Me">About</a>
    </li>
    <li class="item">
      <a href="#Contact">Contact</a>
    </li>
  </ul>
</div>

1 个答案:

答案 0 :(得分:0)

我注意到您并没有为所有值加上前缀,因此它应该像这样:

.header {
    background-color: rgb(235, 223, 201);
    z-index: 100;
    top: 0px;
    margin: 0 auto;
    max-height: 5rem;
    position: fixed;
    border-bottom-style: double;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
        -ms-flex-pack: justify;
            justify-content: space-between;
    width: 100%
}


@media only screen and (max-width: 1210px) {

.logo {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-flex: 1;
        -ms-flex: 1;
            flex: 1;
    width: calc(100% - 50px)
}


.menu-one {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
        -ms-flex-pack: justify;
            justify-content: space-between;
    width: 100%
}
.toggle{
    display: block;
    padding-top: 1.5rem;
    -webkit-transform: translate(-10px);
        -ms-transform: translate(-10px);
            transform: translate(-10px);
    cursor: pointer;
}

.toggle span {
    position: relative;
    width: 36px;
    height: 4px;
    display: block;
    background-color: black;
    margin-bottom: 8px;
    -webkit-transition: 0.5s;
    -o-transition: 0.5s;
    transition: 0.5s;
} 
}

我建议您在编译生产版本时使用Autoprefixer之类的东西。