问题
I'm pretty shocked after confirming that font size is affected somehow while using flexbox on Safari iOS
iOS
Desktop
Code
a {
font-size: 14px;
}
a + a {
margin-left: 1em;
}
.flex {
display: flex;
}
.float > a {
float: left;
}
.float:after {
content: "";
display: block;
clear: both;
}
<div>
<a href="#">hola</a>
<a href="#">adios</a>
<a href="#">hola</a>
<a href="#">adios</a>
<a href="#">hola</a>
<a href="#">adios</a>
<a href="#">hola</a>
<a href="#">adios</a>
</div>
<div class="flex">
<a href="#">hola</a>
<a href="#">adios</a>
<a href="#">hola</a>
<a href="#">adios</a>
<a href="#">hola</a>
<a href="#">adios</a>
<a href="#">hola</a>
<a href="#">adios</a>
</div>
<div class="float">
<a href="#">hola</a>
<a href="#">adios</a>
<a href="#">hola</a>
<a href="#">adios</a>
<a href="#">hola</a>
<a href="#">adios</a>
<a href="#">hola</a>
<a href="#">adios</a>
</div>
What am I missing here?, is this a bug?
回答1:
So, the issue with the font-size appears for both, flex and float:
https://stackoverflow.com/a/22417120/94144
Adding this fixed it:
a {
text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
来源:https://stackoverflow.com/questions/38346494/why-is-flex-affecting-font-size-on-ios