如何将页脚固定为4k分辨率? [英] How to fix the footer in 4k resolution?

查看:85
本文介绍了如何将页脚固定为4k分辨率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我设置为4k分辨率时,页脚会升高,并在其下方显示一个空白.

When i put in 4k resolution, the footer rises and a blank space appears below it.

我尝试将html的高度设置为100%,但它不起作用.

I've tried to put the html height 100%, but it doesn't work it.

> 推荐答案

您可以计算主要内容的高度,以使页脚始​​终位于底部.像这样:

You could calculate the height of the main content such that footer is always at the bottom. Something like:

.header{
  height: 50px;
}
.main {
  height: calc(100vh - 100px);
}
footer {
  height: 50px;
}

JSFiddle

这篇关于如何将页脚固定为4k分辨率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆