我的网站在电脑和安卓智能手机上运行良好,但当我在主页上用苹果智能手机打开我的网站时,我的logo水平伸展,几乎占据了我的页眉宽度,没有空间显示我的汉堡菜单(在我的代码中是.toggle)。
我对它进行了搜索,发现在safari中使用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>
发布于 2019-09-12 23:16:17
我注意到你没有给所有的值加上前缀,所以它看起来应该是这样的:
.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的代码。
https://stackoverflow.com/questions/57909655
复制相似问题