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

问题描述

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



问题:


  1. 我不能使用 c $>


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

    方案

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




    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/

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

08-23 03:23