【问题标题】:Background on the ipad cut in halfipad 的背景被切成两半
【发布时间】:2012-08-09 00:48:02
【问题描述】:

我试图完成这个网站,在我整理代码的时候,我弄乱了背景在 ipad 和 iphone 上的外观。它在所有其他浏览器上看起来都很好,包括原生 android。火狐上有一个小错误,但我现在正在解决这个问题。 有问题的网站:http://morzi.com/constantine/

简介页面有一个指向 ipad css 的链接,但忽略了我只是在胡闹试图解决这个问题。 谢谢!

【问题讨论】:

    标签: iphone css ipad


    【解决方案1】:

    我不知道从哪里开始,我不知道你用什么软件来编码,但它绝对不是手工编码的:s。

    不管怎样,你的 CSS 真的搞砸了。 三种解决方案:

    • 手动编写 CSS,在这种情况下,您可以调整背景位置,使背景与内容对齐,然后您可以重新设计图片以查看左侧的人。

      background-position:top center;
      
    • 重组您的 HTML 和 CSS 以使网站在隔间中工作: |撇开|文章|撇开|

      <aside id='left'></aside>
      <article></article>
      <aside id='right'></aside>
      
      <style>
      aside#right,
      aside#left {
        width:5%;
      }
      article {
        width:90%;
        margin:0 auto;//centers the div
      }
      </style>
      
    • 为具有特定宽度的移动设备创建一个媒体类型,像这样

      @media only screen and (max-device-width: 480px) {//Iphone and below
      //css for mobile device
      }
      @media only screen and (max-device-width: 768px) {//Ipad and below
      //css for mobile device
      }
      

    我希望这对你有帮助并祝你好运:D

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多