我正在尝试构建类似于 this 的页面,当调整浏览器窗口大小时,内容保持垂直居中。
这是我到目前为止所得到的:
http://codepen.io/realph/pen/svuHI
我试图让 .marketing
元素保持垂直居中。虽然页脚贴在页面底部,但在调整浏览器窗口大小时也会向上移动。
感谢任何帮助。提前致谢。
最佳答案
将此添加到您的 .marketing
CSS
position: absolute;
top: 50%;
margin-top: -50px; /* change this to half of the height of the element */
关于css - 调整页面垂直居中内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21171685/