我正在测试这个HTML:
<div>
<div style="width: 940px; background-color: red;">
<div style="width: 50%; background-color: green;">
<div>Sick of spending endless time waiting on your computer?</div>
</div>
</div>
</div>
这适用于桌面或iPhone。
但是当我简单地添加另一个div时:
<div>
<div style="width: 940px; background-color: red;">
<div style="width: 50%; background-color: green;">
<div>Sick of spending endless time waiting on your computer?</div>
</div>
<div style="width: 50%; background-color: orange;">
<div>Sick of spending endless time waiting on your computer?</div>
</div>
</div>
</div>
50%div中的文字开始包装在iPhone上。我在iPhone上测试了Safari和Chrome。
我很困惑为什么在宽度相同的情况下添加另一个div会导致这种情况。
任何帮助都会很棒。
谢谢!
答案 0 :(得分:0)
我自己想出来了。我的页面正在从主题滚动器加载jQuery UI样式表。该样式表中的某些内容导致了此问题。当我删除该样式表时,一切正常。