页脚位置 - 底部和中心 [英] Footer position - bottom and center

查看:146
本文介绍了页脚位置 - 底部和中心的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在网页底部写一个固定页脚的网页。页面的内容具有特定宽度并居中。页脚也有一个特定的宽度,并且必须居中。



问题:


  1. 我不能使用 postiton:fixed - 页脚不居中

  2. 页面内容是从数据库动态加载的,所以我不能知道确切的高度

  3. 如果浏览器窗口非常小,页脚会触及内容并覆盖它。 c $>


    所以我需要像 float:bottom ....

    方案

    看看这个教程。我相信这可能是你正在寻找。
    页脚是固定的,并考虑到它上面的div的高度(为了不重叠)一旦你访问此页面,调整窗口大小,看看我在说什么。



    http://ryanfait.com/sticky-footer/


    I am writing a webpage with a fixed footer on the bottom of the page. The content of the page has a specific width and is centered. The footer also has a specific width and must be centered.

    Issues:

    1. I cant use postiton: fixed - footer is not centered
    2. Page content is loaded dynamically from a database, so I can't know the exact height
    3. If the browser window is very small, the footer hits the content and covers it. A z-index hardly fixes it because I have a gradient on the background set like a body background.

    So I would need something like float: bottom....

    解决方案

    Take a look at this tutorial. I believe this might be what you are looking for. The footer is fixed, and takes the height of the div above it into consideration (as to not overlap) Once you visit this page, resize the window to see what I'm talking about.

    http://ryanfait.com/sticky-footer/

    这篇关于页脚位置 - 底部和中心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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