Html 粘性页脚不是那么粘性

Html 粘性页脚不是那么粘性,html,css,footer,sticky,Html,Css,Footer,Sticky,我有一个网站有一个粘性的页脚,这不是那么粘性,我有一个很难弄清楚它 这是html部分:html.tpl.php <?php ?> <!DOCTYPE html> <head> <?php $head; ?> <title><?php print $head_title='Vit | Kringvarp Føroya'; ?></title> <?php if ($default_mobile_

我有一个网站有一个粘性的页脚,这不是那么粘性,我有一个很难弄清楚它

这是html部分:html.tpl.php

<?php
?>
<!DOCTYPE html>
 <head>
  <?php $head; ?>
  <title><?php print $head_title='Vit | Kringvarp Føroya'; ?></title>
  <?php if ($default_mobile_metatags): ?>
  <?php endif; ?>
  <meta http-equiv="cleartype" content="on">

  <?php print $styles; ?>
  <?php print $scripts; ?>
  <?php if ($add_html5_shim and !$add_respond_js): ?>
  <?php elseif ($add_html5_shim and $add_respond_js): ?>
  <?php elseif ($add_respond_js): ?>
  <?php endif; ?>
</head>
  <body class="<?php print $classes; ?>" <?php print $attributes;?>>
    <div class="container">
    <?php if ($skip_link_text && $skip_link_anchor): ?>
     <p id="skip-link">
       <a href="#<?php print $skip_link_anchor; ?>" class="element-invisible  
       element-focusable"><?php print $skip_link_text; ?></a>
     </p>
    <?php endif; ?>
    <?php print $page; ?>
 </div>
  <?php print $page_footer; ?>
 </body>
  <?php print $page_bottom; ?>
 </div>
</html>
页面地址是www.kvf.fo/vit,看起来工作正常,但在Ipad上,页脚“下沉”到屏幕底部的一半,这很糟糕,因为该网站的主要用户是Ipad用户:/


任何帮助都是非常感谢的

您似乎要提前关闭
body
标记:

 </div>
  <?php print $page_footer; ?>
 </body>
  <?php print $page_bottom; ?>
 </div>

如果希望页脚具有粘性,请在其css中添加此属性

footer {
  position: fixed;
} 

虽然语义不正确,但这不会导致固定页脚不合适。也可能值得注意的是,这需要OP使用
html
元素,除非您指的是表示类的
.footer
。。或者在OP的情况下
#footer
此解决方案有效……但它不会将其保留在页面底部。它将其保留在屏幕底部:/
 </div>
  <?php print $page_footer; ?>
 </body>
  <?php print $page_bottom; ?>
 </div>
footer {
  position: fixed;
}