-1

你好,每次我在那个页面的某个地方使用一个浮点数时,我都会在右边得到一个奇怪的填充。使用普通浏览器还可以,但是在 iPad 上查看有点难看,因为我在右侧得到了 1 厘米左右的填充物。有谁知道如何解决这个问题?

4

1 回答 1

2

对于 ipad 特定的 CSS

    @media only screen and (device-width: 768px) {
         /* For general iPad layouts */
                }

    @media only screen and (min-device-width: 481px) and (max-device-width: 1024px)   and (orientation:portrait) {
         /* For portrait layouts only */
          }

       @media only screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:landscape) {
       /* For landscape layouts only */
          }

编辑 :

    <!--Target iPad-->
     <link href="ipad.css" rel="stylesheet" media="only screen and (min-device-width: 768px) and (max-device-width: 1024px)" type="text/css" />
    <!--Target iPhone 3GS> -->
    <link href="iphone.css" rel="stylesheet" media="only screen and  (max-device-width: 480px)" type="text/css" />
     <!--Target iPhone 4-->
     <link href="retnia.css" rel="stylesheet" media="only screen and (-webkit-min-device-pixel-ratio: 2) and (max-device-width: 480px)" type="text/css" />

jQuery

    if(navigator.platform == 'iPad' || navigator.platform == 'iPhone' || navigator.platform == 'iPod')
   {
    $(window).scroll(function() {
    $('header').css('top', $(this).scrollTop());
    });

   };

并将您的特殊 css 文件用于您的 ipad,当您将其定位为 IPAD 时,在上面的代码中您的文件将是“ipad.css”

于 2012-12-17T14:36:46.187 回答