Problem with Google+ Button Alignment

I arranged my social media buttons in a row - Twitter, Facebook & Google+.

The issue is that the Google+ button is not aligning properly. It appears to be spaced out about 3 times further than the Twitter and Facebook buttons.

I attempted adjusting the padding, but it didn't resolve the issue. I also considered that the width of the Google+ button might be causing the problem, but I couldn't find anything in the code to adjust the width.

HTML:

<div class="copy_right_social">
<div class="social">
<ul id="social">

<li><a href="https://twitter.com/share" class="twitter-share-button" data-url="https://www.whatever.com" data-via="jimsmith" data-lang="en" data-related="anywhereTheJavascriptAPI" data-count="vertical">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></li>

<li><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.whatever.com&amp;send=false&amp;layout=box_count&amp;width=80&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=90" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:80px; height:90px;" allowTransparency="true"></iframe></li>

<!-- Place this tag where you want the +1 button to render. -->
<li><div class="g-plusone" data-size="tall"></div></li>

<!-- Place this tag after the last +1 button tag. -->
<script type="text/javascript">
  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>

</ul>
</div><!-- SOCIAL -->
</div><!-- COPY_RIGHT_SOCIAL -->

CSS:

.copy_right_social {
float: left;
width: 410px;
height: 100px;
margin: 15px 0 0 0;
padding: 0;
border: none;
background-color: #FFF;
}

.social {
list-style-type: none;
list-style-position: inside;
padding: 0;
}

.social li {
display: inline;
text-decoration: none;
padding: 15px 0 0 20px;
float: left;
}

View this example on JsFiddle.

Answer №1

The buttons displayed are not consistent in width. Specifically, the twitter button is 60px wide, the facebook button is 44px, and the gplus button is 50px wide.

To achieve uniformity in button widths, it is recommended to create separate classes for each button and specify their widths as follows:

.social li { float: left; }
.social li.twitter { width: 60px; }
.social li.facebook { width: 44px; }
.social li.gplus { width: 50px; }

For a demonstration with no spacing between the buttons, you can view this functional example on JSFiddle.

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

Exploring menu options in a responsive web design interface

Hey, I'm having an issue with my website header. It looks great on full-width screens, but I need to address low screen resolutions using @media queries. I have a checkbox that reveals the menu items when checked. However, I'm facing an overlay p ...

What is the best way to toggle the visibility of a dynamically created HTML element in ASP.NET?

I'm working on a program that displays two different prices depending on whether the user is registered or not. Registered users will see both the normal price and the discounted price, while unregistered users will only see the normal price. I need t ...

Issue with the alignment of DIV container due to spacing issues

In the screenshot below, there is a DIV container with padding of 15px on the left and right. However, the contents are appearing spaced out downwards for some reason... Other than the left & right padding, no other styling seems to be affecting it. Adjus ...

Convert HTML files to .csv format

Is there a way to export a table from an HTML page directly to a .csv file without having to use additional code? Currently, I am using the following method: private void GenerateExcelFileOnType(string filePath1, ref DataTable dt) { if ...

How do I switch the background-image on li hover and revert it back when I move off the li element?

Looking to update the background image of a div upon hovering over a li element? Check out this example here. So far, I've got that part working fine. But now I want the background picture to revert back to its original CSS when I move away from the l ...

What is the best way to reference a nested jQuery variable, whether global or local, within an HTML document

I've been working on this problem for days with no success. Any help would be greatly appreciated. I'm trying to call a variable from nested jQuery into HTML. The variable is named "PROBLEM". Even after trying to make it global, any updates made ...

My goal is to generate a collection of fullwidth ion-cards using data from an array of objects

I am attempting to iterate through an array of objects in order to generate a set of cards, either FULLWIDTH or halfwidth with the last one centered if the count is an odd number. I have created a component that contains the card layout and I am using *ng ...

What is the best way to include start and end labels on Bootstrap's progress bars?

Is there a way to add start and end labels directly below the progress bar in Bootstrap? Here is an example of what I want: [||||||||------------] <Start Label> <End Label> I have been searching for a solution, but it seems ...

Enter a keyword in the search bar to find what you're looking

I am working on a form where users can select their occupation from a list that is stored in a separate .js file. The list includes various occupations like 'AA Patrolman' and 'Abattoir Inspector'. var occupationSelect = "<select id ...

Internet Explorer is automatically inserting extra vertical space after the first list item in a basic menu design

Does anyone else have trouble with IE? (Or is it just me?) I'm creating a list with a background. The first and last LI elements are 5px high, while the others are 16px high. However, in IE there's a strange blank space between the first and se ...

How to ensure the height of an image in a Bootstrap flex row matches the

I just updated to the latest Bootstrap 5.0 beta version and I'm working with this html code snippet: <div> <div class="d-flex flex-row"> <img src="img/funny.png" alt=""> ...

Arrange two input fields side by side if the quantity of input fields is unspecified

I am currently in the process of developing a project using Angular. I have implemented an *ngFor loop to dynamically add input fields based on the data retrieved from the backend. Is there a way I can ensure that two input fields are displayed on the same ...

Focus on selecting each label within a table using JavaScript

In my current setup, I am attempting to customize radio buttons and checkboxes. Array.from(document.querySelectorAll("tr")).forEach((tr,index)=>{ var mark=document.createElement("span"); Array.from(tr.querySelectorAll("input")).forEach((inp,index ...

What is the best way to center an image in a bootstrap navbar?

After implementing a Bootstrap navbar code with a search bar and logo, I encountered an issue. Despite extending the search bar, my logo image remains uncentered. I attempted to use a class for the image like this: <img class"justify-content-cent ...

Ensure that a specific value is maintained for a property of an element throughout its animation

There are two distinct types of components that I am working with, which I will refer to as .a and .b. It is possible that these components have been assigned certain CSS animations. I do not have the ability to control these keyframes, whether they are a ...

When transitioning between frames in my tkinter program, attempting to update the label causes the program to freeze momentarily

I'm in the process of developing a kitchen order-taking tool. Here's the code I've written so far: from tkinter import * from tkinter import font as tkfont import time import threading class RMS_APP(Tk): ...

The "label for" functionality does not activate the control

<form> <label for="male">Male</label> <input type="radio" name="sex" id="male" /> <br /> <label for="female">Female</label> <input type="radio" name="sex" id="female" /> </form> I am cu ...

Container struggling to contain overflowing grid content items

While creating a grid in nextjs and CSS, I encountered an issue. Whenever I use the following code: display: grid; The items overflow beyond the container, even though I have set a maximum width. Instead of flowing over to the next row, the items just kee ...

Having trouble with the postcss-import grunt plugin?

Here is the layout of my project: my_project |-- css | -- main.css |-- css-dev | -- main.css |-- node_modules | -- bootstrap | -- dist | -- css | -- bootstrap.css |-- package.json `-- Gruntfile.js The contents of my Gr ...

Unfortunately, the header and footer are not lining up correctly with the main body on our mobile site

I've been tasked with creating a fully responsive website, but I'm encountering difficulties with the mobile design. Specifically, when I switch to mobile dimensions like an iPhone 12, the header and footer don't line up properly with the ma ...