Strategies for Effective CSS Footer Placement

In the demo, you can see that my footer bar is not in the correct position. I am having trouble figuring out why the footer is not settling after the content div. Ideally, the footer should be right after the article. I tried searching for specific keywords on Google but couldn't find a solution.

Furthermore, I am unable to apply styles to the about page. I suspect that this issue is related to the first problem.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" lang="en"/>
<title>Title</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" />
<link rel="stylesheet" type="text/css" href="style.css" />  
</head>
<body> 
<div id="containerANA">

    <div id="header">
            <div class="headerAlt">

            </div>
    </div>
     <div class="clear"></div>
<!--End of the header.php-->
<div id="content">
    <div class="finders">
    <div class="find"><a href="#" title="Find">Find</a></div>
        <p>
                                            <a href="#">Sample Link</a>
                                                            <a href="#">Another Link</a>
                                                            <a href="#">Sample Link</a>
                                                            <a href="#">Another Link</a>
                                                            <a href="#">Sample Link</a>
         </p>
    </div>
</div>
<div class="clear"></div> 
    <!--Beginning of the footer.php-->
    <div id="footer">
        <ul>
            <li><a href="http://www.example.com/about" title="about us">about us</a></li>
            <li><a href="http://www.example.com/terms" title="terms of use">terms of use</a></li>
            <li><a href="http://www.example.com/contact" title="contact">contact</a></li>
        </ul>
    </div>
</div>  
</body>
</html>

style.css:

   // CSS styles as given in the original code
    

Answer №1

Your CSS defines the appearance of elements on the page:

.find {
  background: url(img/find.jpg) no-repeat;
  width: 87px;
  height: 54px;
  margin-top: 26px;
  margin-left: 610px;
}

.findler {
  height: 80px;
  width: %100px;
}

However, setting a fixed height for #content restricts the space available for the content inside, leading to overflow.

As a result, the .footer appears below the #content, visually hidden by the overflowed content.

To resolve this issue, consider removing the height attributes from your CSS rules to allow the browser to determine the appropriate height automatically.

Answer №2

element, adjust the height property of the .findler class to be set to auto instead of a specific value. This change will ensure that the content within the div does not extend beyond its boundaries, thus resolving any footer display problems that may be occurring due to the fixed height. Here is the updated CSS code:
.findler {
height: auto;
width: 100%;
}

Answer №3

To resolve the issue with the footer, include the CSS property clear:both; in its styling.

If the problem persists, insert the code

<div class="clearer"></div>
right before the footer section in the HTML markup. Additionally, define the following CSS rule: .clearer{clear:both;}

Answer №4

.... HELLO include the following

min-height:80px; within the .search section

similar to this

.search {
height:80;  // exclude this part
    min-height: 80px;  //  add this part
}

Answer №5

- Check out this resource for a great explanation on footer positioning

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

How to stop the overflow scrollbar in a grandchild element with CSS grid

Encountered an unusual issue while using a combination of CSS grid and overflow auto. In the scenario where there are 3 elements, the outermost element has display: grid, the middle element has height: 100%, and the innermost element has both height: 100% ...

Tips for choosing the class=" * " using jQuery's .html() function

Is there a way to target the string "class" or any other specified string within code retrieved from .html()? If we have an element's HTML content stored in another element (similar to a snippet with preview) <div class="myClass">1</div> ...

What is the best way to prevent the navbar from covering content? The navbar-static-top option helps, but it doesn't allow for fixed-scroll

I am facing an issue with my navigation bar while using asp.net. When I apply the class navbar-fixed-top, the navigation bar becomes fixed and scrolls with the page, but it overlaps the content in the contentplaceholder However, when I switch to the clas ...

This error is thrown when trying to access the property 'message' of an undefined value

I'm currently working on adding an AJAX contact form to my website. However, I've run into a problem where when I try to submit the form, I encounter the following error in Google Chrome: "Uncaught TypeError: Cannot read property 'message&a ...

Empty input fields in Javascript calculations will result in a NaN output

I need to perform a calculation using values entered into form fields and JavaScript. The formula I'll be using is as follows: totalEarnings = income1 + income2 * 0.7 + income3 / 48 + (income4 * 0.7) / 48; The variables income1, income2, income3, an ...

"Customize Bootstrap layout to have a stable width for desktop screens and a flexible width for

I received a psd design with a background for html5-bootstrap development that needed to be responsive. The original psd had a width of over 1200px, with the main container around 900px wide and the background displaying correctly. When converting to HTML ...

The alignment of the background images is off

I am attempting to give a container a background image and then create two div tags using the col-md-6 classes from Bootstrap. The main div's background image is of grass texture, while the two inner divs have a skeleton of a football court as their b ...

I am having trouble with Mpdf's block absolute positioning feature not functioning correctly

I am trying to position my block using absolute, but it seems to be staying in the same place regardless of the left/top attributes I set. Here is the PHP code snippet: $mpdf = new \Mpdf\Mpdf(); $mpdf->WriteHTML($stylesheet,\Mpdf\HT ...

Creating a sleek Bootstrap layout with two columns housing containers within

Struggling with the layout in Bootstrap, I can't seem to figure out how to properly nest a "container" class within a full-width "row" class for perfect content alignment. Check out the image below for reference and a snippet of my code. https://i.s ...

What might be causing issues with the functionality of my user registration form?

I have been working on creating a registration form for users using PHP and MySQL. However, I'm facing an issue where no new records are added to the database when I submit the form. It's strange because the database has worked perfectly fine wit ...

When the down key is pressed in a textarea, choose the list item

I have HTML similar to the following <div class="row"> <textarea id="txtArea" ng-model="input" ng-change="handleOnChange(input);getSearchField(input);" ng-click="search(input)" ng-focus="search(input);" ...

Change Dropdown menu orientation to vertical

Struggling to convert a CSS drop down menu into a vertical menu. I've tried multiple solutions but can't seem to achieve the desired result. Here is my CSS and HTML code, can anyone point out what I might be missing? #sddmT { margin: 0; pa ...

Enhancing animation with mouse movement in css [tips for improvement]

Greetings As I delved into creating a function that would cause a particular behavior (the closer you move the mouse to a div, the closer the div moves to the mouse position on the parent's X axis, with a maximum div position of left:-40% and a minim ...

Incorporate dc.js into your Cumulocity web application

Our team is facing a challenge while trying to integrate dc.js into our Cumulocity web application. While the standalone version works perfectly, we encounter issues when attempting to use it within Cumulocity. Below is the code for our standalone applica ...

What is the best way to use PHP in order to retrieve the element containing the visit ID from the specific row within an HTML table?

I am working on a project that involves populating an HTML table with data from a database. The table includes an approval button for administrators to approve visits and change their status to APPROVED. I am trying to figure out how to select the element ...

Verify image loading using jQuery

<img src="newimage.jpg" alt="thumbnail" /> I am dynamically updating the src attribute of this image. Is there a way to verify if the image has been successfully loaded and take action once it is? Appreciate any guidance on this matter. ...

"Modify the CSS color of h1 based on the presence of a specific class containing spaces in a div

I am currently attempting to modify the color of a heading by referencing a specific div's class. My attempts so far include: .pagetitle-title.heading { color: purple; } <div class="container"> <h1 class="pagetitle-title heading">I ...

In the Firefox browser, tables are shown with left alignment

I recently designed a responsive HTML newsletter with all images neatly wrapped in tables. My goal was to ensure that on smaller screens, the tables stack on top of each other for better readability, while on wider displays, they appear side by side in a r ...

Using Perl script to identify and highlight rows based on specific cell values

I am struggling with how to highlight a row when Column F displays a value of F. I understand that I can achieve this using CSS/JS, but I keep hitting a roadblock. Coding is new to me, so I would greatly appreciate some assistance if possible. Objective: ...

Is it possible for a gradient to maintain the original width of the element to which it is added?

Is there a way to create a gradient that remains static and masks out certain visible parts? I want the countdown timer to darken as it nears the end. Currently, my gradient only reduces colors in between while keeping the left and right colors: (funct ...