相关疑难解决方法(0)

CSS:固定到底部并居中

我需要将我的页脚固定到页面底部并使其居中.页脚的内容可能会一直发生变化,因此我无法通过margin-left将其居中:xxpx; margin-right:xxpx;

问题是由于某种原因,这不起作用:

#whatever {
  position: fixed;
  bottom: 0px;
  margin-right: auto;
  margin-left: auto;
}
Run Code Online (Sandbox Code Playgroud)

我抓了网,一无所获.我试着制作一个容器div和nada.我尝试了其他组合和gurnisht.我怎样才能做到这一点?

谢谢

css positioning sticky-footer

77
推荐指数
5
解决办法
27万
查看次数

页脚位置 - 底部和中心

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

问题:

  1. 我无法使用postiton: fixed- 页脚不居中
  2. 页面内容是从数据库动态加载的,所以我无法知道确切的高度
  3. 如果浏览器窗口非常小,则页脚会点击内容并覆盖它.A z-index几乎没有修复它,因为我在背景设置上有一个像身体背景一样的渐变.

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

css footer sticky-footer

4
推荐指数
2
解决办法
8万
查看次数

如何在屏幕底部修复页脚,无论浏览器或设备如何?

我知道粘性页脚.但我的情况是,我正在开发一个将用于PC和移动设备的网站.因此,显示的页脚由屏幕宽度调整.

页脚的高度会在每个分辨率上发生变化.

任何人都可以知道如何在页面底部(而不是屏幕)显示页脚.某些页面的高度很小,页脚显示在页面之间.

我有以下结构:

<body style="height:100%;">
 <div style="height:100%;">
  <div id="wrapper" style="height:100%; max-width:800px;">
   <div id="header">
    some content
   </div>
   <div id="content">
    some content
   </div>
   <div id="footer" style="position:relative; width:100%;">
    some content
   </div>
  </div>
 </div>
</body>
Run Code Online (Sandbox Code Playgroud)

html css

4
推荐指数
1
解决办法
6万
查看次数

标签 统计

css ×3

sticky-footer ×2

footer ×1

html ×1

positioning ×1