The sticky footer seems to have lost its stickiness

I am facing an issue with the sticky footer on my website, as it doesn't stick properly and I'm struggling to find a solution.

Here is the HTML code snippet: 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>

Now let's look at the page.tpl.php section:

<div id="navigation">

   <?php print render($page['navigation']); ?>

</div>


<header class="header" id="header" role="banner">

  <?php $front_page='http://kvf.fo/vit';

     if ($logo): ?>
         <a href="<?php print $front_page; ?>" title="<?php print   
         t('Heim'); ?>"    
         rel="home" class="header__logo" id="logo"><img src="<?php print 
         $logo; ?  
          >" alt="<?php print t('Heim'); ?>" class="header__logo-image" />     
         </a>
      <?php endif; ?>

<?php if ($site_name || $site_slogan): ?>
<div class="header__name-and-slogan" id="name-and-slogan">
<?php if ($site_name): ?>
 <h1 class="header__site-name" id="site-name">
    <a href="<?php print $front_page; ?>" title="<?php print t('Heim'); 
    ?>" class="header__site-link" rel="home"><span><?php print 
    $site_name; ?></span></a>
 </h1>
<?php endif; ?>

<?php if ($site_slogan): ?>
  <div class="header__site-slogan" id="site-slogan"><?php print 
  $site_slogan; ?></div>
<?php endif; ?>
</div>
<?php endif; ?>


<?php print render($page['header']); ?>

</header>

<div id="main">

<?php print render($page['content']); ?>

</div>

<?php print render($page['footer']); ?>
<?php print render($page['bottom']); ?>

The CSS styles are defined below:

html {
      position: relative;
      min-height: 100%;
     }

body {
      height: 100%;
     }

.container {
            margin: 0 0 125px;
           }

#footer {
         position: absolute;
         left: 0;
         bottom: 0;
         height: 100px;
         width: 100%;
         }

The website address is www.kvf.fo/vit, and although it works well, there seems to be an issue with the footer when viewed on an iPad, where it partially sinks under the screen which is problematic since most users access the site via iPads.

Any assistance or guidance on this matter would be greatly appreciated!

Answer №1

To make your footer stick to the bottom, include the following CSS property:

footer {
  position: fixed;
}

Answer №2

It appears that the body tag is being closed prematurely:

 </section>
  <?php echo $footer_content; ?>
 </body>
  <?php echo $bottom_content; ?>
 </div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

"When attempting to output HTML using PHP, be sure to include a backslash () before special characters like

One issue I am facing is with a PHP code that retrieves HTML content from the database and uses echo to display it on my page. The problem arises when I use echo, as the HTML output ends up looking like this: <div class="\&quot;schema-faq- ...

Can you please explain how to reverse the deletion on both ends just like I demonstrated in my video using VS Code?

Watch a brief video detailing my issue Despite uninstalling all extensions and resetting settings to default, the problem persists. Could I be missing something? ...

Is HTML unable to display decoded %3C?

Two blocks of code with different input strings yield different results: // This does not change HTML var str = "%3Cdiv%3E"; // <div> var str_dec = decodeURIComponent(str); console.log(str_dec); // Console output is `<div>` document.getEleme ...

Place a <p> element at the bottom of a parent <div> that is floating

I am currently facing an issue related to the layout of my webpage. There is a @page media mentioned along with a floating <div> element placed at the top of the page. Inside this <div>, there are an <img> and a <p> tag (which conta ...

Conceal a div containing a specific class during the page's loading process, then reveal it once the

Is there a way to hide a specific div class while a page is loading? Here is the structure I am working with: <div id ="container"> <div class="project-item tv"></div> <div class="project-item radio"></div> <div class="pro ...

Activating a certain class to prompt a drop-down action

My PHP code is displaying data from my database, but there's a bug where both dropdown menus appear when I click the gear icon. I want only one dropdown to appear when clicking the gear of a specific project. Can you help me fix this issue? It's ...

What is the best way to update the content of a text area using PyScript?

Currently, I am in the process of developing a program that involves entering text, clicking a button, processing it, and then displaying the output on a textarea. However, I'm faced with an issue where the textarea fails to update as expected. I woul ...

Is there a way to position right and left divs within a content div on the same top-level?

#textblock{ width: 260px; height: 100%; position; border: 1px solid #999999; padding: 0 5px; float: right; font-size: 95%; background-color: #FEF4CC; } #brevillestandard{ padding: 8px 0 0 5px; ...

Tips for creating a scrolling animation effect with images

I'm currently attempting to create an animation on an image using HTML/CSS. The issue I'm facing is that the animation triggers upon page load, but I would like it to activate when scrolling down to the image. Below is my snippet of HTML: <fi ...

Aligning text at the center using bootstrap

I'm struggling with centering text within my website links, specifically in the navigation section "about me," "portfolio," "skills," and "contact." I've tried adding the text-center class and using the text-align function in the CSS, but nothing ...

What is the best way to customize column width in AG-Grid?

I am looking for a way to dynamically set column width in my table. I have provided a stackblitz example which demonstrates that when changing the screen size, only the table border adjusts, but not the column widths. Is there a way to also change the col ...

Guide on how to add multiple options to a select element in HTML using prototype.js

What is the best way to add multiple options to a select tag in HTML using prototype js? Appreciate your help. ...

Show exclusive results of search queries from the database

I'm currently facing an issue with my PHP code where it displays all the data from the database instead of the specific data I am searching for. I have created a form to enter the desired data but it seems to be pulling all the information. Any sugges ...

moving the array generated on the HTML page to a different page

Can anyone help me with transferring an array from one page to another? I have a list of names in the code below and I want to be able to access and print this array on another page using JavaScript. Your assistance is greatly appreciated! <html> ...

Changing the dimensions of the table border and its color in DataTables

Looking at the provided table structure: library(DT) datatable( iris, style = "default", filter = "top", class = "hover stripe compact" ) I successfully modified the footer border with the following CSS code: table.dataTable.no-footer { bor ...

Issue with Webpack: file-loader failing to load SVG files dynamically in HTML

Configuration in package.json: { "name": "webpackTutorial", ... "devDependencies": { "bootstrap": "^4.3.1", ... "webpack-merge": "^4.2.2" } } Webpack Configuration in webpack.common.js: var HtmlWebpackPlugin = ...

Text Embedded in Object HTML

Feeling stuck and need some guidance. My goal is to insert text inside hexagon shapes, but I'm having trouble making it work. I can change the background-color of the hexagons, add URLs, etc., but adding text seems to be a challenge. Check out the co ...

Achieving success by correctly reaching the window's edge during an event (onscroll)

This happens to be my 1st inquiry. Specifically, I have a navigation menu with a transparent background and I am attempting to alter the background once it reaches the top edge of the window. window.addEventListener("scroll", navSticky); function navSt ...

Using Jquery's closest technique to target a class located outside of the parent div

I am having trouble accessing a class outside of its parent div $(document).on('click', '.delete_photo', function(event){ var del_id = $(this).attr('id'); $.ajax({ type:'POST', cache: false, url:&apo ...

Swap out a portion of HTML content with the value from an input using JavaScript

I am currently working on updating a section of the header based on user input from a text field. If a user enters their zip code, the message will dynamically change to: "GREAT NEWS! WE HAVE A LOCATION IN 12345". <h4>GREAT NEWS! WE HAVE A LOCATIO ...