Social media icons failing to adhere to inline block formatting

Three social icons were designed to be displayed in a row (check out the working JSFiddle - here).

Despite this, when implemented on my Wordpress blog, they are not positioned side by side but rather stacked on top of each other as seen here - .

Is there a way to make my Wordpress version look like the display in the JSFiddle?

HTML

<div data-sumome-share="Facebook" data-sumome-share-text="Great article by the Money Nest team." class="social-icons" id="facebook_icon"><img src="https://www.moneynest.co.uk/wp-content/uploads/2017/01/facebook-white.png" height="20px" class="social-image-align" >share<span data-sumome-share-count="share"></span></div><!-- --><div data-sumome-share="Twitter" data-sumome-share-text="Great article, check it out..." class="social-icons" id="twitter_icon"><img src="https://www.moneynest.co.uk/wp-content/uploads/2017/01/twitter-white.png" height="20px" class="social-image-align">share<span data-sumome-share-count="share"></span></div><!-- --><div data-sumome-share="Linkedin" data-sumome-share-text="Great article, check it out..." class="social-icons" id="linkedin_icon"><img src="https://www.moneynest.co.uk/wp-content/uploads/2017/01/linkedin-white.png" height="20px" class="social-image-align">share<span data-sumome-share-count="share"></span></div>

CSS

.social-image-align {
  position: relative;
  top: -1px;
  height: 20px;
  margin-right: 8px;
}

#facebook_icon {
      background-color: #3B5997;
}
#facebook_icon:hover {
  background-color: #4264a9;
}

#twitter_icon {
      background-color: #1bb2e9;
}
#twitter_icon:hover {
  background-color: #32baeb;
}

#linkedin_icon {
      background-color: #008cd0;
}
#linkedin_icon:hover {
  background-color: #007bb6;
}

.social-icons {
    padding: 8px 5px;
    text-align: center;
    width: 30%;
    display: inline-block;
    color: white;
    text-transform: uppercase;
}

Answer №1

It seems like WordPress is inserting unnecessary paragraph tags within your <div>

If you are unable to remove them, you can hide them by setting their display property to none in the following way.

.entry-content p{
display: none;
}

.social-icons {
    padding: 8px 5px;
    text-align: center;
    width: 30%;
    display: inline-block;
    text-transform: uppercase;
}
<div class="entry-content">
<div data-sumome-share="Facebook" data-sumome-share-text="Great article by the Money Nest team." class="social-icons" id="facebook_icon"><img src="https://www.moneynest.co.uk/wp-content/uploads/2017/01/facebook-white.png" height="20px" class="social-image-align" >share<span data-sumome-share-count="share"></span></div><p><!--
--></p><div data-sumome-share="Twitter" data-sumome-share-text="Great article, check it out..." class="social-icons" id="twitter_icon"><img src="https://www.moneynest.co.uk/wp-content/uploads/2017/01/twitter-white.png" height="20px" class="social-image-align">share<span data-sumome-share-count="share"></span></div><p><!--
--></p><div data-sumome-share="Linkedin" data-sumome-share-text="Great article, check it out..." class="social-icons" id="linkedin_icon"><img src="https://www.moneynest.co.uk/wp-content/uploads/2017/01/linkedin-white.png" height="20px" class="social-image-align">share<span data-sumome-share-count="share"></span></div>
</div>

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 set inner text using jQuery?

The code snippet below demonstrates a specific issue: <span id="test1">some text</span> <span id="test2">some text</span> Upon loading the content, the following JavaScript is executed: alert($('test1').text(); $(' ...

The style remains constant for the animated element despite hovering over it

I am working on a function that makes an element blink continuously. However, when I move my mouse over the element, I want it to stop blinking and be fully visible (opacity 1). Once I move my mouse away, I want the blinking to resume. Here is the code sn ...

Can you demonstrate how to replicate the Instagram-like image feature in a React Native app?

Currently, I am in the process of developing a React Native mobile app specifically for photo albums. My goal is to display square images that are cropped from wider images (Image 1) as Image 2. My question is: What is the best way to properly zoom into t ...

History.pushState is not a function that I utilize in my work

Can anyone assist me with implementing the history.pushState jQuery code? I am struggling to get it to work and I don't have much knowledge on how to do it. Any help would be greatly appreciated. Here is the code I have so far... <!doctype html> ...

What is the process for incorporating an image from your local system into jsfiddle?

<img src="file://C:/Users/User/Desktop/food-Wallpaper.png" height="200" width="600"/> <div id="heading"> EXPLORE The top-rated Eateries </div> <div> <select id="location"> ...

Creating beautifully centered rows of three images dynamically

Seeking a way to dynamically generate centered rows of three images based on the quantity being loaded. The goal is to have one row for three images, two rows for four images, and four rows for ten images. Both the images and their container div are fixed ...

Learn the process of linking directly to specific tab pages instead of the main page

I am working on a project where I have a page with three tabbed menus - Basics and Pro. What I would like to do is create another page with three links, each of which will hyperlink to a particular tab menu. Is there a way to pass a tabbed menu link to an ...

Customize your JQuery/HTML5 Slider to accept user input

Currently, I am developing a time tracking mobile application in MVC4, which includes the use of a slider input type. <input type="range" name="time_verdi" id="slider" value="7.5" min="0.0" max="24" step="0.5" data-highlight="true"/> When using thi ...

Is there a way to extract all the data values starting with "data-" from the selected input fields in HTML5 and compile them into an object?

Looking for a way to automate input values: <input class="form" type="checkbox" name="item1" data-value="{ 'item1':'selected', 'price': 100 }" checked="checked"> <input class="form" type="checkbox" name="item2" data- ...

Ways to automatically insert an icon within a textarea

While attempting to insert an image inside a textarea, I discovered that it seems impossible without using the contenteditable ="true" attribute of a textarea. However, upon visiting the diaspora site, I found out that this can indeed be achieved. I am uns ...

The variable 'DataList1' is not recognized within the current scope

Upon loading a page, I encountered the following error message: 'The name 'DataList1' does not exist in the current context' Below is the code snippet where the issue occurred: listviewvideos.aspx.cs private void BindGrid() { ...

Arrange elements in a vertical layout and align them to the left when they exceed the boundaries of their container

I am seeking a solution for laying out my design, similar to the one shown in this image Essentially, I have a container with a fixed height of 300px. I want to display a list vertically with each item taking up a width of 33%. If the list becomes too lon ...

Special effects for the images动画效果。

Is there a way to add animation effects to images in the about section using this code: <div id="about" class="row section bgimg3"> <div class="col-sm-8"> <h2 style="color:black;">Want to Know More About me?</h2> ...

Aligning table elements for optimal responsiveness

Need a hand with my HTML email code. I'm struggling to center the "resort boxes" when viewed on smaller screens like phones. Tried everything but can't crack it. Appreciate any help! https://i.sstatic.net/V6Rdr.jpg <html> <head> ...

Calculate the total sum of values in a MySQL column and then group the results

I'm currently working on a quiz website and looking to create a leaderboard. The user scores are stored in a database table named 'user_record' with the following structure: 'user_id' - varchar(254) -holds the user id for a score ...

When switching windows or tabs, the user interface of the browser extension vanishes

As someone who is new to web application development and browser extension creation, I have encountered a challenge with my browser extension. When the extension popup is open and I switch browser windows, the UI (popup.html) disappears. It reappears whe ...

Determining the offsetWidth and scrollWidth for option elements within a select field containing the multiple attribute on Internet Explorer 11

My select input element has multiple attributes and a fixed width set. Unfortunately, due to the fixed width, the overflowing content in the x-direction is not visible. To address this issue, I have created a JavaScript function that uses the title attribu ...

Leveraging Flexbox and flexGrow in conjunction with Textfield

I am looking to use Flexbox to separate my components on the screen in a way that positions them correctly. I have 3 rows with textfields that need specific ratios related to the full width: row 1 : 2, 1, 1 row 2 : 1, 1 row 3 : 1, 1, 2 I attempted to ach ...

Tips for automatically closing all other divs when one is opened

I have multiple divs structured like this: <div id="income"> <h5 onclick="toggle_visibility('incometoggle');">INCOME</h5> <div id="incometoggle"> <h6>Income Total</h6> </div> </div> <d ...

Generate an image on Canvas using a URL link

I have a unique URL that generates canvas images with specific parameters. It functions properly when loaded in a browser. The final line of code is: window.location = canvas.toDataURL("image/png"); However, when attempting to use this URL from another ...