小编use*_*434的帖子

横向模式的iPad正在扩展我的网站 - 我不知道如何解决它

我的测试页面位于:http://dev.my-igloo.net/ps-rwd/

我试图让我周围的媒体查询头和更改网站宽度根据浏览器的宽度 - 该网站有对iPad和iPhone,并在那一刻我测试它的iPad和去稍微疯狂工作.

请记住,网站设计/布局目前还不完整,因为我只是在处理初始设置,然后再深入研究完善所有内容.我为每个样式表设置了不同的背景颜色,以便很容易看到加载了哪一个.

我头上有这个标签:

<meta name="viewport" content="initial-scale=1.0, width=device-width" />
Run Code Online (Sandbox Code Playgroud)

如果我像这样设置我的媒体查询:

<!-- Main Stylesheet -->
<link rel="stylesheet" type="text/css" href="ps-default.css" />

<!-- Main Stylesheet -->
<link rel="stylesheet" type="text/css" href="ps-default.css" media="screen and (min-width: 769px)" />
<!-- 768 wide screens -->
<link rel="stylesheet" type="text/css" href="ps-768.css" media="screen and (min-width: 481px) and (max-width: 768px)" />
<!-- 480 wide screens -->
<link rel="stylesheet" type="text/css" href="ps-480.css" media="screen and (min-width: 321px) and (max-width: 480px)" />
Run Code Online (Sandbox Code Playgroud)

当我在横向模式下在iPad上进行测试时,页面会加载默认样式表,但会进行缩放,我必须左右滚动才能看到整个布局,或者捏缩放以缩小以使其适合屏幕.

我怎么能避免这个?我认为通过将初始比例设置为1.0将使其加载而不放大.

然后我将媒体查询改为:

<!-- For Desktop Browsers -->
<link …
Run Code Online (Sandbox Code Playgroud)

html viewport media-queries

5
推荐指数
1
解决办法
8681
查看次数

标签 统计

html ×1

media-queries ×1

viewport ×1