html - 非响应页面的视口(viewport)?

标签 html css

我有一个宽度为 600 像素且无响应的页面。但是,我无法将宽度完全拉伸(stretch)到设备的宽度。

<style>
html, body {
  margin: 0px;
  height: 100%;
  width: 100%;
  padding:0px
}
</style>
<meta name="viewport" content="width=600">

正确的做法是什么?

最佳答案

你需要这样给width=device-width:

<style>
html, body {
  padding: 0;
  margin: 0 auto;     /* Center the body */
  max-width: 600px;   /* Your app width. */
}
</style>
<meta name="viewport" content="width=device-width, initial-scale=1" />

关于html - 非响应页面的视口(viewport)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34837740/

相关文章:

html - CSS :not is not working

CSS grid-template-columns 的行为方式与我不同

javascript - AngularJs 清理和显示 html

html - Chrome 扩展,在浏览器显示之前替换响应代码中的 HTML

javascript - 客户端存储数据的最佳方式

html - Bootstrap 动态按钮宽度

html - 显示 : block on a nav bar (CSS) isn't working like I think it should. ...?

html - revealjs 在 twitter bootstrap 中没有正确调整

jQuery 文本翻转无法正常工作

html - 部分将导航栏移出屏幕