【问题标题】:HTML CSS automatic adjust full vertical length (height)HTML CSS 自动调整全垂直长度(高度)
【发布时间】:2016-04-26 02:37:52
【问题描述】:

我希望我的 div 块自动将它们的高度缩放到屏幕的全长。它应该与屏幕分辨率无关。我怎样才能做到这一点?

Here is an img of my problem.

有什么想法吗?

【问题讨论】:

  • 你能分享你的尝试吗? div 的“高度”是否设置为 100%?
  • 您可以在此处发布指向 jsbin、codepen 或您的实际代码的链接,而不是图片
  • 对不起各位,我在 HTML/CSS 和 steckoverflow 上也是一个该死的新手。感谢您的快速帮助。
  • 欢迎来到 Stack Overflow!寻求代码帮助的问题必须包括在问题本身最好在Stack Snippet 中重现它所需的最短代码。见How to create a Minimal, Complete, and Verifiable example

标签: html css


【解决方案1】:

试试这个,

CSS:

html, body {
    height: 100%;
}
div {
    height: 100%;
}

【讨论】:

    猜你喜欢
    • 2013-02-07
    • 1970-01-01
    • 2013-11-21
    • 1970-01-01
    • 2014-07-21
    • 1970-01-01
    • 1970-01-01
    • 2019-05-29
    • 1970-01-01
    相关资源
    最近更新 更多