Footer Dimension Problem

Whenever I resize the browser window, the content in the footer starts stacking on top of each other. However, there comes a point during resizing when things start to look messy. As someone new to this, I am wondering if there might be a better approach to handling this issue. Thank you! You can view the problem by checking out the jsFiddle file here: http://jsfiddle.net/robontrix/h21fyywn/#&togetherjs=cjr35cIPDP

HTML Footer

 <footer>
    <div id="footer-right">
        <ul>
            <li>ABOUT US</li>
            <li><a href="">Contact Us</a></li>
            <li><a href="">FAQ's</a></li>
            <li><a href="">Site Map</a></li>
        </ul>
        <ul>
            <li>SUPPORT OUR CAUSE</li>
            <li><a href="">Donate</a></li>
            <li><a href="">Volunteer</a></li>
            <li><a href="">Fundraising Events</a></li>
        </ul>
        <ul>
            <li>FOLLOW US</li>
            <li>
                <a href="#Facebook"><img src="img/facebook-icon.png" alt="Facebook Logo" class="social-icon"></a>
                <a href="#Instagram"><img src="img/instagram-icon.png" alt="Instagram Logo" class="social-icon"></a>
                <a href="#Twitter"><img src="img/twitter-icon.png" alt="Twitter Logo" class="social-icon"/></a>
                <a href="#Pinterest"><img src="img/pinterest-icon.png" alt="Pinterest Logo" class="social-icon"/></a>
            </li>
        </ul>
    </div>
    <div id="footer-left">
        <p id="footer-slogan">BREAK THE <strong>SILENCE</strong> <br>AND <strong>CYCLE</strong>    OF ABUSE</p>
        <p id="copyright">Copyright&copy; 2014 International Child Advocacy Network</p>
    </div>
</footer>

CSS Footer

/**********************
FOOTER
**********************/
footer {
font-family: 'Open Sans', sans-serif;
max-width:950px;
background-color:#434a54;
font-size:0.75em;
clear:both;
color:#e6e9ed; overflow:auto;
margin: 0 auto;
padding:5px;
}
footer h3{
padding-left: .9em;
font-family: 'Open Sans', sans-serif;
}
footer ul {
display:inline-block;
list-style-type: none;
}
footer ul li{
list-style:none;
text-decoration:none;
margin-left: 1em;
}
footer ul li a{
color:#e6e9ed;
text-decoration:none;
}

footer a:hover {
color:#FFFFFF; /*Change hover color to make it more prominent*/
}


/**********************
RIGHT SIDE OF FOOTER - Contains links and social media icons
**********************/
#footer-right {
float:right;
margin-right:15px;
}

#footer-right li:nth-child(1) { /*Styles footer headers*/
font-weight:bold;
font-size:1.2em;
padding-bottom:4px;
}

.social-icon {
display:inline-block;
width:24px;
height:24px;
margin-bottom:22.7px; /*controls height of "follow us" in footer*/
padding:1px;
border-radius: 20%;
}

/**********************
LEFT SIDE OF FOOTER - Contains copyright and slogan
**********************/
#footer-left {  
float:left;
padding-left: 2em;
text-align:left;
font-size: 1.35em;
display:inline-block;
line-height: 1.5em;
}

#footer-slogan {
font-family: 'Georgia', 'Droid Serif', sans-serif;
}

#copyright{
font-size: .75em;
text-align:left;
margin-top: 5px; 
display:inline-block;
font-family: 'Open Sans', sans-serif;
} 

Answer №1

The space in your layout is caused by the floating action of footer-right. When the viewport width is less than approximately 888px, footer-left gets pushed below and footer-right takes up all available space on the right.

To address this issue, consider using CSS media queries for responsive design. For your specific scenario, you can apply the following adjustments:

    @media only screen and (max-width: 888px) {
        #footer-right {
            float: left;
        }

        /*align footer-right to footer-left*/
        #footer-right ul {
            padding-left: 20px;
            padding-right: 20px;
        }
    }

I have made changes to the jsfiddle to demonstrate the solution. To learn more about CSS media queries and see additional examples, visit css-tricks.

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 ensure that two col-lg-6 elements stay horizontally aligned on mobile screens?

What is the best way to keep two col-lg-6 columns aligned horizontally on mobile devices using Bootstrap? ...

Preventing access to the direct Thank You page: Steps using HTML, Javascript, and AJAX

There is a specific requirement: I need to prevent users from accessing the Thank You page directly. If a user tries to access the Thank You page directly, they should be redirected back to the Registration page. The solution cannot be cookie-based or .ht ...

Attempting to optimize a webpage design for compatibility with Google's mobile-friendly testing tool

After much searching on the forum, this is my first post, so I kindly ask for patience! I am dealing with a 20-year-old website that urgently needs to be optimized for mobile devices. With almost 2200 pages, manual editing is out of the question, so I nee ...

Transforming an array into an object for generating a JavaScript report

I am trying to organize data from an array that represents a table. The array looks like this: table = [['john', 'male', 24, '12/12/12'], ['jane', 'female', 24, 12/12/12]] The goal is to allow the user t ...

Dividing the background horizontally into two sections with contrasting colors

Is it possible to achieve a background image like this using CSS? https://i.sstatic.net/xS70g.png ...

Is there a way to alter the background in React Native after a delay of 1 second?

Need help with maintaining background color inside the box for 0.5 seconds and then making it disappear, similar to YouTube comment alarm functionality. Initial rendering shows background color https://i.sstatic.net/uQ1nj.png After 0.5 seconds, the backg ...

The click() function in jQuery is not functioning as expected when linked to an anchor tag generated in PHP

On my website, I have PHP code that generates HTML anchor elements. Here is a snippet of the code: if(!$isOnOwnPage) echo '<a id="message-button" class="button">Message</a>'; if($isOnOwnPage) echo '<a id="add-img-butt ...

Embed fashion and graph elements into a CSV document (generated from <script>)

Encountering an issue with my code. I am looking to export an HTML table to a CSV file (specifically Libre Office Calc, regardless of csv, xls or xlsx format, as long as it runs on a Linux Server). Found a script online that works well after some modificat ...

Prevent overlapping of divs

Having some trouble with my portfolio page. I've got a section set up with nested divs, but when I try to adjust the position of the divs, they end up on top of each other. Can anyone offer some guidance? #portfolio { width: 650px; background-col ...

How come my diary section (5th) is showing up/operating in my teacher's section (4th)?

My journey with HTML, CSS, and Javascript began as a beginner. After following a tutorial on YouTube and making some modifications, everything was running smoothly until the diary section unexpectedly appeared under the teacher's section, which should ...

What steps do I need to follow in order to incorporate the SQLite database into my application?

My attempt to establish a database connection with my system is met with an issue where, upon calling the function, the application's browser displays this message: The "granjas" table is empty Below is the code snippet for reference: In JavaScript ...

Why do my cards keep shrinking instead of moving to a new column when using flexbox and flex-flow?

I'm facing an issue with my flexbox that is causing my items to constantly shrink instead of moving to a new row. I've tried various solutions but nothing seems to work. I have removed the CSS for elements like headers that I believe are unrelate ...

Arrange li elements in a row with the ability to scroll horizontally

I'm attempting to create a paging effect using CSS but I've run into a bit of confusion. I want to arrange all the li elements next to each other within a specified parent width so that they scroll horizontally. <ul class="flow" style="width ...

What will occur if I use an XMLHttpRequest to request a file that is currently being downloaded?

My goal is to enhance links in a progressive manner using the PJAX style. My plan was to layer this on top of some regular prefetch <link>s: <link rel="prefetch" href="next.html"/> If the browser has already downloaded next.html, then the PJA ...

Unable to extend the data-toggle dropdown to the entire width of the screen

Is there a way to make my navbar dropdown menu expand to the full width of the screen without leaving white space on the left side? I am using Bootstrap and have included a media query in my CSS as shown below. https://i.sstatic.net/US3ce.png <nav clas ...

Ways to resolve the issue of my sidebar displaying at the bottom of the page on smaller screens

Below is the code snippet that generates a Bootstrap page with lorem text and a sidebar. The issue I am facing is that when the browser window size gets smaller, the sidebar appears at the bottom instead of the side. On very small resolutions, it becomes h ...

Toggle the visibility of content with jQuery or Ajax

As I work on designing a webpage at this link, I am facing an issue with the projects tab due to my lack of experience in proper protocol. The plan is to have a side menu where users can select different content options (CAD, FEA, MATLAB, etc.), which wi ...

Tips on how to update the styling of an active link

http://jsfiddle.net/G8djC/2/ Looking to create a tabbed area where content changes based on the tab clicked. The Javascript function switches the link class to active upon clicking. However, struggling to change the color of the active tab beyond the firs ...

Disconnect the parent when the child is clicked in CSS

I am struggling to find a solution for this issue. Currently, I have a hover effect where when I click on a submenu li item, the parent li also gets highlighted. You can see the behavior in the image below: https://i.sstatic.net/Ie6Lb.png Is there any w ...

What is the best method for using XMLhttpRequest in PHP to append options to a select element?

I'm looking to dynamically fetch values from a MySQL database using PHP and then add them as choices within a select element. Here is my HTML code: <label for='listDivision'>Division</label><select id='listDivision&apos ...