Tips for aligning social media icons above an image on a webpage

Image

I am seeking advice on how to position three social media icons on top of each picture, aligned to the left but in line with the image. Below is the code snippet I have been working on:

body {
background-color: #1a1a1a;
}

#downloadbutton{
width:127px;
height:48px;
text-align: center;
/* text-indent:-9999px; */
border:none;
margin-top:20px;
cursor:pointer;
}

#downloadbuttonhover:hover{
color:#fff;
background-color: #b40000;
opacity:0.9;
}


.buttonDownload{
display: inline-block;
position: relative;
padding: 10px 25px;
  
background-color: #b30000;
color: white;
  
font-family: 'Oswald', sans-serif;
text-decoration: none;
font-size: 0.9em;
text-align: center;
text-indent: 15px;
}

.buttonDownload:hover {
background-color: #333;
color: white;
}

.buttonDownload:before, .buttonDownload:after {
content: ' ';
display: block;
position: absolute;
left: 15px;
top: 52%;
}

/* Download box shape  */
.buttonDownload:before {
width: 10px;
height: 2px;
border-style: solid;
border-width: 0 2px 2px;
}

/* Download arrow shape */
.buttonDownload:after {
width: 0;
height: 0;
margin-left: 3px;
margin-top: -7px;
  
border-style: solid;
border-width: 4px 4px 0 4px;
border-color: transparent;
border-top-color: inherit;

animation: downloadArrow 2s linear infinite;
animation-play-state: paused;
}

.buttonDownload:hover:before {
border-color: #b30000;
}

.buttonDownload:hover:after {
border-top-color: #b30000;
animation-play-state: running;
}

.clearfix {
  clear: both;
}

.divWithBtn {
display: inline-block;
}

.divWithBtn a{
  display: block;
  margin: 0 auto;
}
<div class="container">
</br>
<span class="textformat1"><center><b>Albums</b></span></center>
</br>



<div id="sharebar">
    <a href="https://twitter.com/share" class="twitter-share-button"{count} data-url="www.tekmillion.com" data-text="TekMillion - Download Albums http://www.tekmillion.com/albums.html" data-via="tekmill">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
<hr>
<div class="fb-share-button" data-href="http://www.tekmillion.com/albums.html" data-layout="button_count"></div>
</div>
<script>var switchTo5x=true;</script>
<script src="//w.sharethis.com/button/buttons.js"></script>



<center>
<div class="clear">
<div class="divWithBtn">
<img src="socialmedia/twitterwhiteandblack.png" alt="twitterwhiteandblack" width="30" height="30">
<img src="socialmedia/googlepluswhiteandblack.png" alt="googlepluswhiteandblack" width="30" height="30">
<img src="socialmedia/facebookwhiteandblack.png" alt="facebookwhiteandblack" width="30" height="30">
<img src="images/london%20To%20Turkey%20-%20Front%20Cover.jpg" alt="london%20To%20Turkey%20-%20Front%20Cover" width="200" height="200">
<a href="LONDON%202%20TURKEY%20VOL.1.zip">
<img src="images/downloadbutton.png" alt="downloadbutton" width="150" height="50"></a>
</div>
<div class="divWithBtn">
<img src="images/LONDON%20TO%20TURKEY%20VOLUME%202%20(FRONT%20COVER).jpg" alt="LONDON%20TO%20TURKEY%20VOLUME%202%20(FRONT%20COVER)" width="200" height="200" border:none;>
<a href="LONDON%202%20TURKEY%20VOL.2.zip">
<img src="images/downloadbutton.png" alt="downloadbutton" width="150" height="50"></a>
</div>
<div class="divWithBtn">
<img src="images/Love%20%26%20Hate%20Volume.1%20(Front%20Cover).JPG" alt="Love%20%26%20Hate%20Volume.1%20(Front%20Cover)" width="200" height="200">
<a href="LOVE%20%26%20HATE%20VOL.1.zip">
<img src="images/downloadbutton.png" alt="downloadbutton" width="150" height="50"></a>
</div>
<div class="divWithBtn">
<img src="images/Gurbet%20Eli%20Volume.1%20(Front%20Cover).JPG" alt="Gurbet%20Eli%20Volume.1%20(Front%20Cover)" width="200" height="200">
<a href="GURBET%20ELI%20VOL.1.zip">
<img src="images/downloadbutton.png" alt="downloadbutton" width="150" height="50"></a>
</div>
</div>
</center>
</br>
</div>

To view and interact with the album images and links, please visit:

Your assistance is greatly appreciated.

Answer №1

Place your icon in a new div with the class .divWithBtn.

Please note: I have adjusted the height and width to ensure proper display.

body {
background-color: #1a1a1a;
}

#downloadbutton{
width:127px;
height:48px;
text-align: center;
/* text-indent:-9999px; */
border:none;
margin-top:20px;
cursor:pointer;
}

#downloadbuttonhover:hover{
color:#fff;
background-color: #b40000;
opacity:0.9;
}
  
<!-- More CSS code here -->

.socialIcon > a{
  display:inline;
  }

Edit:

To meet your requirements, place your icon in the new div as shown in the example above, using the socialIcon class. It should be positioned below the download button.

You can include the image inside an anchor tag for better linking purposes.

Additionally, apply the following CSS to style your links accordingly:

.socialIcon > a{
  display:inline;
  }

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

Displaying a Bootstrap button and an input box next to each other

Looking for advice on aligning or arranging a button and input box side by side in Bootstrap without grouping. I've searched online for examples, but they all involve grouping of elements. jsfiddle: https://jsfiddle.net/erama035/p9dagmL3/3/ <div ...

What is the best method for setting the height of an empty inline block element to match the line height of its container?

By default, inline-block elements adjust their height based on the container's line height only when they have content. However, I've noticed that empty or whitespace-only inline block elements default to a height of 0 (observed in Firefox). Is ...

Can you explain the process for setting the css property text-fill-color in IE and Mozilla browsers, similar to how I set -webkit-text-fill-color for Webkit?

The color displays correctly in Chrome, but how can I make it work in both IE and FF? CSS #Grid td.note div.has-note i { -webkit-text-fill-color: #b4efa8; } ...

Exploring the Differences: innerHTML versus appendChild for Loading Scripts

Struggling to dynamically load scripts onto the DOM? function addScript(fileName) { document.body.innerHTML += `<script src='components/${fileName}/${fileName}.js'></script>` } addScript('message-interface') I prefer th ...

Enabling Autoplay for HTML Videos on Safari iOS 14.2

Recently, I've observed that my autoplay videos are not functioning on iPhone iOS 14.2. Surprisingly, everything was working fine prior to this version. Is there anyone familiar with a solution or workaround for this issue? Perhaps there's a met ...

Creating an infinite loop of SVG rectangles pulled from a database

As I extract svg rectangles from a database using Python, I find myself hardcoding the process in order to change the colors of each rectangle in my CSS style sheet. With potential scalability issues in mind - if there were 100 rectangles - I am wondering ...

Filling a table cell with a div that spans 100% height

I am currently working with Bootstrap and I am attempting to create three columns filled with text overlaying a rectangle. The squares within the columns should have equal height and there needs to be spacing between them. Through the use of display:table ...

Strip the CSS styling from an image (the CSS being included in the generated code)

I need to remove the CSS styling from an image, but I can't modify the generated code where it's coming from. My actual code looks like this: <div class="bubble"> <img id="one" src="/static/webupload/MyronArtifacts/images/descarga.png ...

utilize the "li" element to function as a clickable button

My HTML code contains ul elements, as shown below: <ul class="nav" id="loadCategories"> <li class="sub-menu"><a href="#">Search by category</a> <ul class=""> <li><a href="#">Food</a></li> ...

Navigational bar with horizontal scrolling in Bootstrap

I'm looking to create a navbar that remains fixed at the top of the screen, without any vertical scrolling. However, I still want users to be able to scroll horizontally when necessary. The first div in the code below achieves the desired effect, stay ...

Personalized dropdown appearance

During my work on a select box, I discovered that custom styling is not possible. I attempted to use some plugins but did not find one that met my needs. I am seeking a dropdown menu with options in both black and gray, similar to this template but using ...

What is the impact of hash urls on SEO?

Looking for back button support options? Check out some recommended plugins here. However, considering that the page loads via JavaScript based on hash tags, can this impact search indexing by Yahoo/Google/Bing? I am contemplating using HTML5 state push fo ...

I need assistance from someone knowledgeable in HTML and CSS. I am trying to create a div that dynamically increases its width until it reaches a specific

Seeking assistance to create a dynamic div that continuously expands its width until it reaches a maximum of 540px. It should start at 75px. Below is the HTML and CSS code I've attempted: .Loading-Screen { background-color: black; color: alicebl ...

The date selection tool is failing to appear on the screen

I successfully created a date picker using Bootstrap. Here is the code: <div class="form-group"> <div class='input-group date' id='datetimepicker1'> <input type='text' class="form-control" /> <s ...

`We are experiencing alignment issues with the Bootstrap drop-down menu`

I'm struggling to understand why my menu isn't aligning properly on the sub dropdowns. They are appearing at the lower edge of their parent cell, making navigation quite difficult. You have to drop down diagonally just right to access the next me ...

Having trouble with the HTML5 meter tag in Internet Explorer 10?

For those who are having trouble with the HTML5 meter tag not displaying correctly in Internet Explorer, I am wondering if there is a workaround other than using a progress bar. Any tips or solutions would be greatly appreciated. Thank you! ...

Conflicting styles between Bootstrap and Formstack are causing radio buttons to appear only partially visible

Encountering a conflict between Bootstrap (4.1.3) and Formstack CSS when trying to embed a form in a website. The radio buttons are not fully visible, with the issue located in the "label" class ("fsOptionLabel"). Adjusting the line height provides a parti ...

Data loaded by the load() function disappears following an ajax action

I need assistance with a sorting page I am creating that displays content from a database and allows users to sort it using listjs. The issue I am facing is that when I click on any button, the loaded content disappears. Strangely, manually adding content ...

The image does not automatically adjust size when the window is resized

I'm having an issue with my HTML and CSS code that is supposed to display two images side by side and resize when the browser window shrinks, but it's not working as expected. Even after removing all classes on the parent divs, the images still ...

Navigate to various parts of the page easily with a stationary navbar

After successfully implementing buttons to jump to different sections of my page using IDs like this: <button id="niftyBtn"><a href="#nifty">Things</a></button></br> <div id="nifty">Blah</div> I'm facing an ...