一种方法来纠正背景比例在iPad上的Safari? [英] A way to correct background scaling in iPad's Safari?

查看:183
本文介绍了一种方法来纠正背景比例在iPad上的Safari?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个div容器(100%×100%)。

I have a website using a huge background image (2000x1500) in a div container (100% x 100%).

当我在一个不同的比例大于内容(〜80%)。打开Safari浏览器上该网站在iPad上它被缩小(〜40%)

When I open that site on Safari on an iPad it gets scaled down (~40%) in a different proportion than the content (~80%).

我搬去和宽度为100%和100%的高度和溢出一个div的背景,一个img标签设置为隐藏。完全相同的情况。

I moved the background to an img-tag in a div with 100% width and 100% height and an overflow setting "hidden". Exactly the same happens.

是否有一个CSS设置,可以帮助Safari在相同比例的内容?

Is there a CSS Setting that can help Safari to scale down background images in the same proportion as the content?

推荐答案

您一定要创建用于iPad的一个单独的样式表。
您可以使用以下方法来做到这一点:

You should definitely create a separate stylesheet for the iPad. You can use the following to do so:

<link rel="stylesheet" media="only screen and (max-device-width: 1024px)" href="../ipad.css" type="text/css" />

在这个环节,你会发现你的网站在iPad上的方向和如何处理它的信息。

On this link, you will find information about the orientation of your website on the iPad and how to deal with it.

我的建议是,要为iPad版本的网站,无论你做什么,你应该创建并添加像上面显示的链接标签创建一个单独的样式表(CSS文件)。

My advice would be, to create a separate stylesheet (css file) for the iPad version of your site, no matter what you do, you should just create it and add a link tag like the one shown above.

如果你有一个图片是2000x1500px为iPad版本的背景下,可以减少它适合iPad的,如果这是你已经有了一个问题的唯一的事情。我说你应该图像的尺寸减小到1,024像素,并在iPad上的独立的样式表声明它,你会看到最终的结果。

If you have a background of a picture that is 2000x1500px for the iPad version, you can reduce it to fit the iPad, if that's the only thing you've got a problem with. I'd say you should reduce the size of the image to 1024px and declare it in the separate stylesheet for the iPad, and you will see the end result.

让我知道如何去。

BTW,你应该读这篇文章,以及:<一href=\"http://www.inspiredm.com/2010/02/09/ipad-design/\">http://www.inspiredm.com/2010/02/09/ipad-design/

BTW you should read this article as well: http://www.inspiredm.com/2010/02/09/ipad-design/

这篇关于一种方法来纠正背景比例在iPad上的Safari?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆