菜鸟教程小白 发表于 2022-12-13 16:51:48

html - iOS 上的字体太小,但在安卓和桌面上可以吗?


                                            <p><p>iOS 手机/平板电脑是否存在无法调整字体和 CSS 设置大小的问题?当我在 Android 上查看您的 View 时,它工作正常。有人可以解释或帮助我解决问题吗?见下图:</p>

<p>安卓</p>

<p> <a href="/image/3clf5.jpg" rel="noreferrer noopener nofollow"><img src="/image/3clf5.jpg" alt="Android"/></a> </p>

<p>iOS</p>

<p> <a href="/image/8HywZ.jpg" rel="noreferrer noopener nofollow"><img src="/image/8HywZ.jpg" alt="iOS"/></a> </p>

<p>链接:<a href="https://jsfiddle.net/w9357vxo/" rel="noreferrer noopener nofollow">https://jsfiddle.net/w9357vxo/</a>
这是一个片段代码:</p>

<pre><code>&lt;div class=&#34;twocol smwidth&#34;&gt;
    &lt;div class=&#34;col1&#34;&gt;
         &lt;h2&gt;The Situation&lt;/h2&gt;
         &lt;p&gt;
    For vacationers, deciding to take a cruise is exciting, but choosing the right one requires a great deal of information, cost consideration, and input from friends and family. Carnival wanted to make the process easier by recommending cruises that would best suit the lifestyles, demographics and interests of their passengers.
         &lt;/p&gt;
         &lt;p&gt;
    They also wanted to make it easy to share details with travel companions. Carnival needed a more personalized communication strategy to help their prospective passengers navigate through the decision process.
         &lt;/p&gt;
   &lt;/div&gt;
   &lt;div class=&#34;col2&#34;&gt;
         &lt;h2&gt;The Solution&lt;/h2&gt;
         &lt;p&gt;
    Carnival collected email addresses on their homepage as part of the lead generation efforts, butNimblefish helped them to capture additional relevant data that would lead to a more personalized communication.Prospective passengers were asked:
         &lt;/p&gt;
         &lt;ul class=&#34;list&#34;&gt;
             &lt;li&gt;Tell us about yourself! (Are you a Family with small kids? Teens? A group? Single?)&lt;/li&gt;
             &lt;li&gt;Where do you want to go? (Alaska? Mexico? Caribbean? Undecided?)&lt;/li&gt;
             &lt;li&gt;How do you do fun? (Relax in the sun? Shopping? Explore Nature? Island Adventure?)&lt;/li&gt;
             &lt;li&gt;Are you new to cruising? Are you a former guest of Carnival? Where do you live?&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>css:</p>

<pre><code>h1 {
margin:0;
margin-bottom:25px;
padding:0;
font-size:24px;
font-weight:700;
text-align:center;
}
h2 {
margin-bottom:20px;
padding:0;
font-size:18px;
font-weight:800;
}
p {
font-size:17px;
color:#808285;
}
.list li {
font-size:17px;
color:#808285;
}
</code></pre></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>问题不在于字体大小,而在于您如何做出响应。您应该摆脱固定宽度并用最大宽度替换它们。您还应该将 <code>img {max-width: 100%;}</code> 添加到图像中。当你这样做时,一切都会得到适当的响应,一路解决你的问题。我已在此文件中修复它:<a href="https://jsfiddle.net/uek15fmq/" rel="noreferrer noopener nofollow">https://jsfiddle.net/uek15fmq/</a> </p></p>
                                   
                                                <p style="font-size: 20px;">关于html - iOS 上的字体太小,但在安卓和桌面上可以吗?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/37554791/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/37554791/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: html - iOS 上的字体太小,但在安卓和桌面上可以吗?