为什么我的网站在我的iPhone Safari浏览器上看起来与众不同,我做错了什么?

时间:2013-03-19 13:33:36

标签: iphone html css xhtml safari

我已经用HTML编写了一个网站,并在Windows计算机上查看了谷歌Chrome,Safari,IE 9,Firefox和Opera网络浏览器的结果。在Android设备(三星S3)上查看我的网站时,结果与桌面PC / MAC上的结果相同,但在我的iPhone 5或我的朋友iPhone 4s上查看时,结果却不同。有些文本被放大了,有些则没有。我很困惑,我希望有人能尽快帮助我。

期待你的回答,亲眼看看我的意思:

 Visit http:///www.islandtoislandshipping.com

代码HTML:

        <p id="intro">Island to Island Shipping and Removal LTD is a developing 
        organisation keen to<br />provide a high standard of service to its 
        customers. The company specialises in worldwide shipment of any household                 
        products or any goods, however, we<br />specialise directly to the Caribbean  
        (but that is not our limitation!). Island to Island Shipping and Removal LTD 
        provide an efficient, reliable and prosperous service<br />ensuring the highest  
        care is taken to in the process of delivery.</p>

        <img id="aim" src="imgs/aim.png" width="450" height="174" />

    <p>
    <br />As a company, we aim to provide our clients with all the 
    services they<br />require, from practical (shipping, removals) 
    to advise on packing materials<br />and household maintenance. 
    </p>

    <p id="stafftext">All our staffs are very friendly and courteous,<br />feel free to      
    discuss any queries you may have<br />and they will be happy to help. We are a<br   
    />dedicated team aiming to provide a stress<br />free experience for our customers.
    </p>

CSS代码:

#intro{
position:relative;
margin-top:20px;
}

#aim{
margin-top:20px;
}

#stafftext {
position:relative;
margin-left:190px;
margin-top:90px;
 }

.staffimg {
margin-top:-100px;
}

#link1 {
position:relative;
margin-left:130px;
bottom:130px;
text-align:center;
font-size:9px;
 }

2 个答案:

答案 0 :(得分:0)

我会尝试将-webkit-text-size-adjust: 100%添加到您的CSS中的body。它将禁用iOS设备上的文本大小调整。

https://developer.mozilla.org/en-US/docs/CSS/text-size-adjust
http://blog.55minutes.com/2012/04/iphone-text-resizing/

答案 1 :(得分:0)

iPhone浏览器不喜欢分割边距或填充css样式。尝试使用连接边距/填充方式。

而不是写作:

margin-top: 90px;
margin-left: 190px;

尝试:

margin: 90px 0 0 190px;

这是保证金:右上角左下角;

相关问题