What is preventing my basic icons from showing up?

I am currently in the process of designing a "flat design" website, and I have opted to incorporate Simple Icons into my project. My goal is to have the background of the Simple Icon darken while the white overlay image remains unchanged. To achieve this effect, I crafted a list element (specifically a navbar) with anchor tags nested inside. Initially, I attempted setting the background image for the anchor as the icon itself, and adjusting the background color of the list item accordingly. Despite adding a transition property to fade the background color upon hover, it did not yield the desired outcome so I had to remove it from the code. Below you will find the snippet of CSS related to this segment of the site:

div#nav{
float:right;
width:auto;
height:37px;
padding-top:15px;
padding-right:15px;
padding-bottom:5px;
background-color:rgba(100,100,100,0.3);
border-left-color:rgba(255,255,255,0.2);
border-right-color:rgba(255,255,255,0.2);
border-right-width:1px;
border-right-style:solid;
border-left-width:1px;
border-left-style:solid;
border-top-width:1px;
border-top-style:solid;
border-top-color:rgba(255,255,255,0.2);
margin-top:102px;
margin-left:2px;
}
#nav ul{
padding:0;
list-style:none;
margin:0;
}
#nav ul li{
width:32px;
height:32px;
margin-left:15px;
display:inline-block;
background-color:#000000;
border:0;
}
#nav ul li a{
z-index:10;
}
#facebook{
width:32px;
height:32px;
background-image:url('images/facebook.png');
}

Furthermore, below is the HTML structure pertaining to the aforementioned CSS styling:

<div id="nav">
<ul>
<li><a id="facebook" ></a></li>
<li><a id="twitter" ></a></li>
<li><a id="youtube" ></a></li>
</ul>
</div>

While I'm presently focusing on implementing functionality for just one icon at the moment, the end goal is to seamlessly display multiple icons along with smooth transitions between them. Any assistance or guidance in achieving this would be greatly appreciated. Here are the links to the individual simple icon images:

Answer №1

Include

display: block;

Incorporate this code into your anchor elements

By default, anchor tags are displayed inline. Adding this CSS will ensure that they are visible even without content inside them.

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

Setting the height of children within an absolutely-positioned parent element

I am facing an issue with adjusting the size of children elements based on their parent. The scenario is as follows: HTML <div class="video"> <div class="spot"> <img src="..." alt=""> <button>x</button> </div ...

Make a line break occur automatically after every 7 divs are displayed

Looking to create a grid of equal height and width divs using AngularJS to form a 7x5 square: ---------------------- | | | | | | | | ---------------------- | | | | | | | | ---------------------- | | | | | | | | ---------------------- ...

What is the best way to synchronize the scale of images with the tempo of a song?

I just started learning CSS, JS, and HTML and I have a question about scaling an image based on a song. Despite searching through YouTube and various forums, I still haven't found a solution. Any help would be greatly appreciated :) Here is the HTML ...

Avoid passing down line-height settings to elements within nested elements

Is there a way to prevent the span styled with font-size: 12px from inheriting the line-height of the span styled with font-size:18px? I need the line-height value to be 1.5 for both 18px and 1.5px font sizes, but I am unable to separate the two spans. ht ...

Challenges with the dropdown menu navigation bar

I am struggling with my dropdown menu and sign up/sign in buttons as they are not aligning properly. I have tried various coding methods but haven't been able to fix the issue. Can someone provide me with suggestions on how to rectify this problem? c ...

Is there a way to potentially utilize window.open() to open a specific section of a webpage?

My HTML page consists of 2 div blocks and 2 links. I want to open the content of the first div in a new window when the first link is clicked, and the content of the second div in another new window when the second link is clicked. You can find the code h ...

Positioning a div inside another div using CSS

I'm having issues with a nested div causing trouble for me. <div style="border:solid 20px #ccff33;border-radius:10px;height:300px;width:300px;margin:20px;display: inline-block"> <img src="images/f35.jpg" style="margin-right:10px" /> ...

impact on the shape of the region's map

Is it possible to add an effect like a border or opacity when hovering over an area in an image map? I've tried using classes and applying hover effects with borders or opacity, but nothing seems to work as expected. Here's my code: <img src= ...

Discover the Magic of Jquery Hover Effect Unleashed

$('.outerBox').hover( function() { $(this) > $('.innerBox').stop(); $(this) > $('.innerBox').slideDown(750); }, function() { $(this) > $('.innerBox').stop(); $(this) > $(&apos ...

What steps should I follow to make a sticker adhere to a div?

I'm currently in the process of designing a sticker that attaches to the top of a div, much like this: https://i.sstatic.net/aG329.png <div className="upgrade-premium"> <div className="upgrade-team"> <h1>Prem ...

The process of running npx create-react-app with a specific name suddenly halts at a particular stage

Throughout my experience, I have never encountered this particular issue with the reliable old create-react-app However, on this occasion, I decided to use npx create-react-app to initiate a new react app. Below is a screenshot depicting the progress o ...

What is the best way to make a drop down menu list appear when I click on the parent li, and then show the sub li using JavaScript?

I have a code that includes an image, HTML, and CSS code. Can anyone please tell me how I can set up a drop-down menu list to open the sub <li> elements when I click on a parent <li> using JavaScript? You can see the appearance of the code in t ...

Change an ASP page into an image format such as JPEG or PNG

Seeking assistance to convert my classic ASP page containing label controls styled with positioning to images in JPG or PNG format, and then send them using CDO. Using Dreamweaver for this task. Any help would be greatly appreciated. ...

What could be causing the list-group and list-group-item classes to not take effect in this situation

Currently diving into Bootstrap 5, I decided to play around with lists. Here is a snippet of the code I'm working with: <ul class="list-group"> <li class="list-group-item">Cras justo odio</li> <li class="l ...

What is the most effective method for implementing a background repeated image in Foundation 4 framework?

Currently, I am utilizing the foundation4 framework for my website. In order to achieve a repeating tiled background, I have crafted a custom CSS file and included the following code snippet: body { background: url(img/floorboardsbg.jpg) repeat; } Whi ...

How can I achieve a "tab selector" effect with "input" elements on a website?

I am attempting to add "tab-highlights" similar to the ones shown above the form in the screenshot to my "input" elements. This will help users know which field they are currently focused on or have clicked. I have tried using "focus" and "::selection" to ...

Content overflowing the container - Designed to adapt to different screen sizes

I'm currently working on a project within the Bootstrap 3 framework and struggling with an issue regarding text overflow in extra small view. The text is not behaving as expected, as it should stick to its container and break accordingly. I've ex ...

React-Tooltip trimming

Currently, I am facing a dilemma that requires some resolution. The issue at hand is related to the placement of React-Tooltip within the List element. Whenever it's positioned there, it gets clipped. On the other hand, placing it at the bottom isn&a ...

Which files do I need to import to enable custom range thumbs in Bootstrap?

Despite importing the scss/_bootstrap.scss manifest file, I am experiencing issues with Bootstrap's custom form range thumb not working. It seems to only function properly when importing dist/bootstrap.css or using the CDN. Below is my manifest file ...

tips for scrolling divs horizontally within the main container

I've been attempting to scroll horizontally, but even though the scroll bar is visible, it's not functioning. Here's the code: <!DOCTYPE html> <html> <head> <title>qwe</title> </head> <body> < ...