There seems to be some excess white space surrounding the icon bar

As a newcomer to HTML/CSS, please excuse any mistakes I may make. My goal is to design a responsive social media footer using Font Awesome icons and Bootstrap. However, I am facing an issue with white spaces appearing on the sides of the footer. Any suggestions on how to resolve this?

Encountering white squares beside the icons

a {
    text-decoration: none;
    color: #fff;
}
ul {
    padding:0;
    list-style: none;
text-align: center;
}
.footer-social {
    width: 50%;
    display:block;
    margin: 0 auto;
}
.social-icon {
    color: #fff;
background-color: #000000;
}
.social-icons li {
    vertical-align: top;
    display: inline;
    height: 100px;
text-align: center;
}
.social-icons a {
    color: #fff;
    text-decoration: none;
}
.fa-facebook {
    padding:10px 16px;
    -o-transition:.5s;
    -ms-transition:.5s;
    -moz-transition:.5s;
    -webkit-transition:.5s;
    transition: .5s;
    background-color: #000000;
    font-size: 1.5em;
}
.fa-facebook:hover {
    background-color: #3d5b99;
color: #ffffff;
}
.fa-twitter {
    padding:10px 12px;
    -o-transition:.5s;
    -ms-transition:.5s;
    -moz-transition:.5s;
    -webkit-transition:.5s;
    transition: .5s;
    background-color: #000000;
    font-size: 1.5em;
}
.fa-twitter:hover {
    background-color: #00aced;
color: #ffffff;
}
.fa-soundcloud {
    padding:10px 10px;
    -o-transition:.5s;
    -ms-transition:.5s;
    -moz-transition:.5s;
    -webkit-transition:.5s;
    transition: .5s;
    background-color: #000000;
    font-size: 1.5em;
}
.fa-soundcloud:hover {
    background-color: #eb8231;
color: #ffffff;
}
.fa-youtube {
    padding:10px 14px;
    -o-transition:.5s;
    -ms-transition:.5s;
    -moz-transition:.5s;
    -webkit-transition:.5s;
    transition: .5s;
    background-color: #000000;
    font-size: 1.5em;
}
.fa-youtube:hover {
    background-color: #e64a41;
color: #ffffff;
}
.fa-instagram {
    padding:10px 14px;
    -o-transition:.5s;
    -ms-transition:.5s;
    -moz-transition:.5s;
    -webkit-transition:.5s;
    transition: .5s;
    background-color: #000000;
    font-size: 1.5em;
}
.fa-instagram:hover {
    background-color: #0073a4;
color: #ffffff;
}
.fa-spotify {
    padding:10px 14px;
    -o-transition:.5s;
    -ms-transition:.5s;
    -moz-transition:.5s;
    -webkit-transition:.5s;
    transition: .5s;
    background-color: #000000;
    font-size: 1.5em;
}
.fa-spotify:hover {
    background-color: #e25714;
color: #ffffff;
}
div {
background-color: #000000;

}
<div class="footer-social">

<ul class="social-icons">

    <li><a href="" class="social-icon"> <i class="fa fa-facebook"></i></a></li>
    <li><a href="" class="social-icon"> <i class="fa fa-twitter"></i></a></li>
    <li><a href="" class="social-icon"> <i class="fa fa-soundcloud"></i></a></li>
    <li><a href="" class="social-icon"> <i class="fa fa-youtube"></i></a></li>
    <li><a href="" class="social-icon"> <i class="fa fa-instagram"></i></a></li>
    <li><a href="" class="social-icon"> <i class="fa fa-spotify"></i></a></li>
</ul>


</div>

Answer №1

.footer-social {
    width: 100%;
    display:block;
    margin: 0 auto;
}

To ensure the footer bar spans the entire width of the page, adjust the width from 50% to 100% in the CSS code for .footer-social.

Answer №2

Make the footer extend to the full width of the page:

.footer-social {
  width: 100%;
}

Check out this JSFiddle demonstration for more information: http://jsfiddle.net/z8vc9vq4/2/

Answer №3

Eliminate the width: 50%; declaration in the CSS code for .footer-social:

.footer-social {
  /* width: 50%; */
  display:block;
  margin: 0 auto;
}

View Demo

Answer №4

Ensure the main footer div is set to 100% width

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

CSS - Separate grid items and expand to the maximum width within the column

Is it possible to have two buttons in one row, where one is wider than the other? If the viewport size becomes too small, can the buttons automatically switch to sit in a single column with the smaller button stretching its width to match the wider one? I ...

What is the best way to ensure that a <label> remains vertically aligned with its <form>?

I'm struggling to incorporate their suggestions into my design. How can I align my label to the left of my input field on the same line? Also, I'm a beginner in coding so please excuse any mistakes in my code: body { background-color: #f5f ...

Various backgrounds in assorted sizes across multiple pages

Take a look at the background feature here: The background is properly applied to the body element with correct sizing. However, when viewing it on this page: It appears stretched and distorted. I compared the CSS for both pages using the inspector tool ...

How can you turn off CSS3 animations for browsers that don't support them

Upon page load, a fade-in animation is applied to the main container. Although it functions properly in most browsers, it seems to have an issue in IE(9). Is there a method to identify if the user's browser does not support CSS3 animations and disabl ...

The contents on the table are surpassing the card

Hello, I am encountering an issue with the table contents exceeding in size. You can see a screenshot of the problem https://i.sstatic.net/YDYoP.png Interestingly, when I un-collapse the sidebar, the view is perfectly fine. Here is a screenshot for refere ...

Obtain the attribute value from an HTML option element

Here is the code snippet I am working with: <select class="form-control valid"> <option isday="False" value="2">Value 1</option> <option isday="True" value="3">Value 2</option> <option isday="True" value="4"> ...

Is it possible to seamlessly transition from regular text to italic text?

Wondering if there is a possibility to create a hover effect where regular text, used as an anchor, smoothly transitions into oblique or italicized text with an underline to indicate it is a clickable link. Here's a representation of what I have in m ...

Ensure that the floating div is positioned along the right side and adjusts to accommodate the

I've been searching for a solution to this issue, but it seems like I might not be articulating it correctly because I haven't been able to find an answer yet. On my page, there is a 'quick links' button that is supposed to stay fixed ...

Issues with the Tumblr platform's back-to-top button functionality

I am quite comfortable with HTML and CSS, but I'm struggling to make the 'back to top' button work on my Tumblr page. Can someone please give me a hand? I've included some JQuery code to make the text fade in and out when scrolling (inf ...

Is there a way for me to adjust my navbar menu items so they are aligned to the right

Currently, I'm designing a navbar and I'm facing an issue with aligning a specific part to the right side: Here is the current setup I have: Moreover, the collapsible navbar feature seems to be malfunctioning. When I try to shrink the screen, t ...

Issue: Images are not displaying in jQuery slideshow.Possible cause: There

I'm currently working on developing a slideshow using jQuery and HTML. However, I've encountered an issue where only one image is displaying while the other slides are not showing up at all. I've been troubleshooting this problem but haven&a ...

What is the best way to attach a single block of Javascript code to different div elements without executing them simultaneously?

Running a small ecommerce shop, I have designed product cards using HTML, CSS, and a bit of Jquery for animations. However, a problem arises when clicking the "add to cart" button on any product card as it adds all items to the cart and triggers animations ...

Tips for showcasing devnagri script from user input on a php webpage

On one of my PHP pages, I have changed the font for input to Devnagri. Now, I need to display it on the next PHP page and also insert it into MySQL. The first page, index.php, contains the following details... <table width="535" height="54" border=" ...

How to vertically align a mat-checkbox and mat-form-field in Angular Material

My goal is to display text Fields and checkboxes side by side, similar to the layout shown in this image: https://i.sstatic.net/7QyLy.png However, I am facing an issue with aligning <mat-form-field> and <mat-checkbox> vertically. How can I res ...

When a click event occurs, apply a class to every HTML element at varying levels

Being new to programming, I am currently exploring a problem related to my college application. My goal is to loop through the entire navigation menu and apply an additional CSS class that will modify its style. I also need this modification to affect the ...

Concealing two div elements based on string content

I am working on a unique Wordpress blog post layout that showcases personnel profile cards, displaying 12 individuals at a time. Depending on whether or not a person has a Twitter handle entered in the backend, certain elements should either be shown or hi ...

Is Angular File API Support Compatible with HTML5?

When checking for HTML5 File API browser support in my code: private hasHtml5FileApiSupport; constructor(@Optional() @Inject(DOCUMENT) document: Document) { const w = document.defaultView; this.hasHtml5FileApiSupport = w.File && w.FileReader & ...

Troubleshooting problems with CSS inline-block widths

In my website, I have a container div with two columns inside, both set as inline-block elements. The left column is where users make selections from a shopping catalogue, while the right column displays the output of those selections. The problem arises ...

Struggling with accurately configuring the input field in AngularJS?

Struggling with clearing the input field I have been attempting to clear the input box with ng-model="newInstruction.instructionText" after a new instruction text is added. However, the input field does not clear even after trying to reset it to an empty ...

Adding content from a dialog box to the body of an HTML document

I'm struggling with a problem involving adding a value from a textbox in the dialog box to my HTML body. <div id="dialog-form"> <form> <label for="name">Name</label> <input type="text" name="name" id="txt2 codein ...