【问题标题】:CSS Window resizing on Browsers heightCSS 窗口在浏览器高度上调整大小
【发布时间】:2013-07-23 15:45:48
【问题描述】:

我尝试创建一个具有固定宽度且居中的窗口。 还应具有可变高度,具体取决于浏览器视口高度,顶部偏移为 20 像素,底部偏移为 20 像素;

我不想为此使用 JQuery / JS,它应该是纯 css。

这里有一些代码片段:

#viewport should be the the browsers height / width container
#window should be the resized window (centered in middle, filling up all height except of top 20px and bottom 20px

http://jsfiddle.net/ejRTU/87/

有人知道如何解决这个问题吗?

【问题讨论】:

    标签: css position positioning css-position


    【解决方案1】:

    使用position:absolute并将top和bottom属性设置为10px;看到这个小提琴jsfiddle.net/ejRTU/88/

    【讨论】:

    • 感谢我的英雄 ;D ^^(将其标记为答案,但我必须等待 5 分钟)
    猜你喜欢
    • 2018-07-29
    • 2015-04-20
    • 2023-04-07
    • 2015-06-18
    • 2014-12-25
    • 1970-01-01
    • 2011-11-19
    • 2012-02-23
    • 1970-01-01
    相关资源
    最近更新 更多