2012-12-24 40 views
0

我有一个网站(http://ukchina-trading.com/)与下面的头:在iphone上无缝缩放网站标题。

HTML

 <div class='leftImage'> 
      <img src='image/unionjack.png'> 
     </div> 
     <div class='title'> 
      <h1>J Plus Trading</h1> 
      <h2>Briding the gap between China and the UK</h2> 
     </div> 
     <div class='rightImage'> 
      <img src='image/chinawings.png'> 
     </div> 

CSS

.title h1 { 
    font-family: 'Droid Serif', Georgia, Times, serif; 
    text-align: center; 
    font-size: 68px; 
    line-height: 65px; 
    padding-top: 60px; 
    margin-bottom: 80px; 
} 

.title h2 { 
    font-family: 'Droid Serif', Georgia, Times, serif; 
    text-align: center; 
    position:relative; 
    top:-88px; 
    left:3px; 
    font-size: 16px; 
    color: #FF3300; 
} 
.rightImage { 
    position:absolute; 
    right: 150px; 
    top: 2px; 
} 

.leftImage { 
    position:absolute; 
    left: 150px; 
    top: 2px; 
} 

当该网站是在计算机上查看头被罚款,但当在iphone屏幕上查看时,图像被推到标题上,隐藏它。

什么是重做标题来阻止它的最好方法?

+0

如果添加了'位置:relative'到'.title'格,并赋予其更高的'Z-索引',至少标题不会隐藏;) –

回答

0

我建议最好的事情是将标志带入900px宽度的网站。

他们保持对“歼八方商贸”文本的左侧和右侧,但只使用浮动而不是绝对定位。

0

你的问题是你使用的是绝对定位,因为这会导致图像是在相同的位置,无论在页面上其他任何东西。而不是绝对尝试使用float:left;和float:就在你的左右图像上,这样文字就不会被推到它上面。您可能需要创建额外的含保证金或填充的div,使图像定位如何你想他们