html - 网站的响应在 iphone 10 或任何 iOS 中不工作

标签 html ios css iphone bootstrap-4

我在 iframe 中使用以下代码进行网站重定向,它的响应能力在除 iphone 移动版 Safari 浏览器之外的所有浏览器中都非常好。我在不同型号的 iPhone 上测试过它。

<head>
<title>My Website</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>

<frameset rows="100%,*" border="0">
<frame src="https://website.com/customer?id=104" frameborder="0" />
<frame frameborder="0" noresize />
</frameset>

当网站在任何浏览器中加载时,它会将网站重定向到我的网站并针对不同的屏幕正确打开它。 但是在 iOS 手机上打开网站时,它没有响应。显示奇怪的网站布局。


我用下面的代码用 iframe 替换了 frameset,但同样的问题仍然存在。

   <head>
   <title>My Website</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
   body, html
        {
            margin: 0; padding: 0; height: 100%; overflow: hidden;
        }

        #content
        {
            position:absolute; left: 0; right: 0; bottom: 0; top: 0px; 
        }
</style>
</head>
<body>
<div id="content">
<iframe  width="100%" height="100%" frameborder="0"         
src="https://website.com/customer?id=104">
</iframe>
 </div>
</body>

最佳答案

框架集是 obsolete and deprecated , 加上在 HTML5 中不受支持,可能 Safari 会忽略它,如果你想在你的网页中显示另一个网页,你可以使用 iframe .

您可以在 w3schools 示例中看到如何使用它们:

iframe {
  width: 1px;
  min-width: 100%;
  *width: 100%;
}
<!DOCTYPE html>
<html>
<body>

<iframe src="https://www.w3schools.com">
  <p>Your browser does not support iframes.</p>
</iframe>

</body>
</html>

关于 HTML elements - Frames 的更多信息,正如我们所读到的,iframe 是目前 HTML5 中唯一有效的框架。

关于html - 网站的响应在 iphone 10 或任何 iOS 中不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50485819/

相关文章:

HTML 页面无法加载 CSS 文件,找不到资源错误

ios - 如何从 didFailProvisionalNavigation 方法获取失败的 URL

ios - xcode5.1 中出现类型转换错误

css - 在图像中创建一个带有文本的 div。 (响应式设计)

javascript - html 表卡住列与纯 javascript,小 CSS

html - 如何使通过 "class"响应包含的背景图像

javascript - Jquery 问题 : click icon > display block > always on top

android - 在 Titanium 中的选项卡组上方创建标题栏

html - 我的 chrome 扩展中的弹出窗口很小,不显示数据

javascript - 获取Firefox中某个标签的高度,我设置为display : table; in CSS