Footer Design Problems

There seems to be some strange behavior with the footer on my website. In the demo, you'll notice that the HR tag in the location section is being pushed to the bottom of the page, altering the layout. Additionally, I'm attempting to make the Facebook Icon float to the left so it appears beside the HR tag in the "Network With Us" section. While my CSS appears correct to me, this is my first time using section tags in HTML5.

I'm also encountering difficulties applying a background-color or margin-top: 50px to my #footer. It's almost as if the #footer element is not responding.

Check out my Demo

#footer {
    background-color:#95643d;
    width:100%;
    margin:30px 0px 0px 0px;
    clear:both;
}
#footer h3 {
    font-family: 'Dancing Script', cursive;
    font-weight:700;
    color:#FFF; 
    font-size:2em;
}
#footer hr {
    width:60%;
    float:left;
    height:4px;
    background-color:#FFF;
}
#footer p {
    margin:0px;
    padding: 0px;
    color:#FFF; 
    font-family: 'Arimo', sans-serif;   
}
#footer_logo {
    width:25%;
    float:left; 
    background-color:#95643d;   
}
#footer_logo img {
    margin:20px 0px 0px 20px;   
}
#footer_network {
    width:25%;
    float:left; 
    background-color:#95643d;   
}
#footer_contact {
    width:25%;
    float:left; 
    background-color:#95643d;   
}
#footer_network img {
     float:left;   
}
}
#footer_location {
    width:25%;
    float:left; 
    background-color:#95643d;   
}

Answer №1

Here is a CSS template you can use for your footer:

    /* Styling for the Footer */

#footer {
    background-color:#95643d;
    width:100%;
}
#footer h3 {
    font-family: 'Dancing Script', cursive;
    font-weight:700;
    color:#FFF; 
    font-size:2em;
    text-align: center;
}
#footer hr {
    width:100%;
    float:left;
    height:4px;
    background-color:#FFF;
}
#footer p {
    margin:0px;
    padding: 0px;
    color:#FFF; 
    font-family: 'Arimo', sans-serif;   
    text-align: center;
    margin-bottom: 10px;
}
#footer_logo {
    width:100%;
    float:left; 
    background-color:#95643d;   
}
#footer_logo img {
    margin: 10px auto;
    display: block;
}
#footer_network {
    float:left; 
    background-color:#95643d;   
    width: 33%;
}
#footer_contact {
    width: 33%;
    float:left; 
    background-color:#95643d;   
}
#footer_network img {
    margin: 0 auto;
    display: block;  
}
#footer_location {
    display: inline-block;
    background-color:#95643d;   
    width: 34%;
}

https://i.sstatic.net/3w39Y.png

Answer №2

Can't seem to get the #footer to apply a background-color or have a margin-top of 50px. It's like the #footer is ignoring my commands.

When dealing with floats, the parent element collapses, requiring you to clear the floats. One common method is using the clearfix class. You can use it on your element in this manner:

#footer:after {
  content: "";
  display: table;
  clear: both;
}

I've created a fiddle with cleaner code that you can either use as-is or take parts of it for your convenience. Here's the link: https://jsfiddle.net/r3ruzLL2/2

You can view the result of the fiddle here: https://jsfiddle.net/r3ruzLL2/2/embedded/result/

EDIT: To adjust the position of the Facebook logo, one simple solution is to use a negative value for the margin-top.

Answer №3

Here is a new guideline to include:

section{
    overflow:hidden;
}

Answer №4

Here is a solution that should help resolve your issue: http://jsfiddle.net/weissman258/kpo4y108/10/.

Below are the changes I made:

#footer {
    display:inline-block;
}

#footer_network {
    position:relative;
}
#footer_network a {
    position:absolute;
    left:0;
}
#footer_location {
    display:inline-block;
}

I also removed the following:

#footer_network img {
     float:left;   
}

Edit: Noticed that the first line on location was aligned to the right, so I made another adjustment:

#footer p {
clear:left;
}

Answer №5

Check out this fiddle link: https://jsfiddle.net/kpo4y108/6/. Your HTML has unnecessary breaks and redundant backgrounds in different divs if you're using only one color. Feel free to ask any questions.

<div id="footer">
    <section id="footer_logo">
        <img src="http://nuskinprinting.com/atticstash/images/as_logo.png" />
    </section>
    <section id="footer_network">
        <a><img src="http://nuskinprinting.com/atticstash/images/facebook_icon.png" /></a>
       <h3>Network With Us</h3>
        <hr />
    </section>
    <section id="footer_contact">
        <h3>Contact Us</h3>
        <hr />
        <p> <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7127180718101f31101507101f1214151d1805191e5f121e1c">[email protected]</a><br />(972)999-9999 </p>
    </section>
    <section id="footer_location">
        <h3>Location</h3>
        <hr />
        <p> Orange Circle Antique Mall<br />118 South Glassell Street<br />Orange, CA 92866<br />(714)538-8160<br />Mon. 10 a.m. - 4:45 p.m.<br />Tues - Sat 10 a.m. - 5:45 p.m.<br />Sun. 11 a.m. - 5:45 p.m. </p>
    </section>
</div>

CSS:

/* Styled Footer */

#footer {
    background-color:black;
    width:100%;
    margin:30px 0px 0px 0px;
    clear:both;
    float:left;

}
#footer h3 {
    font-family: 'Dancing Script', cursive;
    font-weight:700;
    color:#FFF; 
    font-size:1.5em;
    margin:0px;
    padding:0px;
}

#footer hr {
    width:60%;
    float:left;
    height:4px;
}
#footer p {
    margin:0px;
    padding: 0px;
    color:#FFF; 
    font-family: 'Arimo', sans-serif;   
    float:left;
    word-wrap:break-word;
}
#footer_logo {
    width:25%;
    float:left; 
}
#footer_logo img {
    margin:20px 0px 0px 20px;
    max-width:80%;
}
#footer_network {
    width:25%;
    float:left; 
}
#footer_contact {
    width:25%;
    float:left; 
}
#footer_network img {
     float:left;
    width:25px;
    height:25px;
    margin: 5px 5px 0 0;
}

#footer_location {
    width:25%;
    float:left; 
}

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

What is the best way to save data in order to effectively showcase a collection of images that together form a single entity in a game

Apologies for the unclear title, I struggled to find the right words. Recently, I delved into the world of 2D game development and was amazed by the capabilities of HTML5's Canvas element. Currently, I am working on my first basic project to grasp th ...

Get rid of irritating photo borders

It's a mystery to me why no one seems to have the answer to this question. Take a look at . The spacer images are surrounded by borders. While I could use empty divs instead of spacer images, I'm using them here to make a point. This issue also ...

Troubleshooting: Dealing with overflow problem in a span element containing an image tag

One issue I encountered involves overflow. A div is set to overflow: hidden, with all elements inside positioned absolutely. These elements consist of a span tag containing text and an image tag. An arrow allows control of the span tag moving forwards or b ...

Tips on how to customize an HTML form submission appearance

Take a look at my file upload form below: <form action="upload.php" method="post" enctype="multipart/form-data"> <input type="file" name="filetoupload" id="filetoupload" onchange="this.form.submit();"> </form> I am trying to figure out ...

Rotation using CSS in Internet Explorer 8

Can anyone help me with a CSS solution for rotating elements in IE8? I've tried some solutions that claim to work in IE8, but they're not working for me. What am I doing wrong? Here's what I've attempted: <!DOCTYPE html> <htm ...

What is the most efficient way to evenly separate a CSS3 gradient?

Is there anyone who can assist me in achieving an even gradient break? body { height: 2500px; background: -webkit-linear-gradient(#000000 1%,#FFFFFF 1%,#FFFFFF 13%,#2ecc71 13%,#2ecc71 30%,#3498db 30%,#000000,#FFFFFF,#34495e); } I've been att ...

Guide on how to gather values into a variable from the DOM using jQuery

Trying to make this function: The current issue I'm facing is that when changing a digit (by clicking on a hexagon), I want to save the selected number as the value of a hidden input field next to the digit in the DOM. Any ideas on how to achieve th ...

After a CSS animation, the Div element disappears from view

I recently implemented a CSS3 delayed animation on page load. Everything was working smoothly until I noticed that after the animation finishes, the DIV reverts back to visibility: hidden. .content-left { margin-left: 100px; margin-top: 32px; ...

What is the most efficient method for implementing uniform rounded corners in HTML/CSS across different web browsers?

Is there a simple way to achieve cross-browser compatibility without a lot of tedious work? I'm looking for a solution that works effortlessly on IE7+, FF2+, and Chrome, without resorting to using tables which may be outdated. Is there a middle ground ...

Tool for tracking response time on basic Ajax-requested webpage

Looking for an easy way to use ajax to load content onto a page. I want the loaded content to wait before appearing on the page, but using jQuery's .delay() function didn't work as expected. Any suggestions on how to achieve this? Appreciate any ...

To see website changes, refreshing with Ctrl + F5 is necessary in the browser

I have a simple website that uses only HTML and CSS. Whenever I upload new files to the site, they do not appear in the browser until I perform a hard refresh by pressing CTRL + F5. Does anyone have any suggestions on how to fix this issue? ...

My website is currently experiencing issues with all of the CSS references not working. This problem applies to both external and internal CSS files and consistently

I'm encountering 404 errors when trying to load both internal and external files on a website through my browser. My code snippet looks like this: <link rel="stylesheet" type = "text/css" href='anoceanofsky.css'/> Despite clearing m ...

Clicking a button causes the entire HTML body to shift

My current webpage setup is quite simple, featuring a drop-down menu that appears upon clicking a button. However, when the button is clicked, the drop-down menu suddenly shifts the entire contents of the page. I'm unsure of what's causing this i ...

Creating a structured layout with Bootstrap

I'm facing some confusion with the behavior of Bootstrap. This page suggests that for a 3x3 grid, one could use code similar to the following: <div class="container"> <div class="row"> <div class="col align-self-start"> ...

What is the best technique to position a div at the bottom of a container that has a height of 100

After many attempts and searching for answers, I'm still struggling to figure out how to make the div float to the bottom with 100% height. I've even considered if it's an issue with Pure or something else entirely. It's definitely frus ...

Is there a way to incorporate a background image fadeIn effect for ul using CSS3?

I have a list on my webpage where each item is displayed with a CSS3 rotate animation. After the animation finishes, I want to set a background image with a FadeIn effect. To achieve this, I created a "addbg" class for the ul element like so: ul.addbg{ ...

CSS - Issue with dropdown sub-menu alignment despite using absolute positioning in relation to parent button

Title fairly explains it all. I'm having trouble getting my dropdown submenus to align perfectly with the bottom of the parent list item element. The list item has a relative position, while the submenu has an absolute position. I've attempted ...

Tips on concealing sub-menu until cursor hovers over it

I'm currently in the process of creating a navigation bar for a website, but I'm encountering some challenges with the submenu. While I've managed to position the submenu relative to its parent ul, I'm struggling with making it invisibl ...

Primeng - Concealed dropdown values within a scrollable table header

Recently, I integrated Primeng p-table with a filter and frozen column feature (with one column being fixed while the others are movable). However, I encountered an issue with the select dropdown in the header. When I try to open the dropdown, the values a ...

Vue.Js allows developers to easily set a default selected value in a select dropdown menu

Having trouble with getting the default selected value using select in VueJs. I've attempted two different approaches: Using id and v-model fields in the select like this: <select v-model="sort_brand" id="sort-brand" class="form-control"> ...