Eliminate the delicate border in header images using bootstrap

I am struggling with some code that includes bootstrap and an SVG sprite in a header/menu, but there is a thin gray background line appearing in the icons.

Here is the link to the code on CodePen

Can anyone please help me solve this issue? I've tried setting border properties to 0 and adjusting colors/backgrounds, but I seem to be overlooking something.

It seems like it's inheriting a value from normalize.less:

border-image-width: 1;

For reference, here is a snippet of the code:

.icon {
  display: inline-block;
  background-repeat: no-repeat;
  background-image: url(https://cdn.rawgit.com/srisitar/test/master/sprite.svg);
}

.icon-facebook {
  width: 96px;
  height: 96px;
  background-position: 0 0;
}

.icon-twitter {
  width: 96px;
  height: 96px;
  background-position: -128px 0;
}

<

div id="home">
       <a href="">
                  <img class="icon icon-twitter"></a>
                                                </div>

If anyone knows how to remove the gray line, I would greatly appreciate your assistance. Thank you!

Answer №1

The reason for this issue is the usage of an img tag without a src attribute. Chrome is basically indicating the size of the container with no content inside.

If you do not intend to insert an image between the anchor tags, then it's best not to use the img tag at all. There is no need to place anything within the tags in this case.

Check out a demo here.

Answer №2

Instead of utilizing the img tag, consider using the background-image property in your css with a div element.

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

Emphasize sections of text within a chart

Looking for a Specific Solution: I've encountered similar problems before, but this one has a unique twist. What I'm trying to achieve is to search for a substring within a table, highlight that substring, and hide all other rows (tr's) th ...

The background image is not showing up

I've been grappling with a CSS background-image dilemma that's got me stumped. Here's the situation: CSS #yes { background-image:url("../tick.png"); background-repeat: no-repeat; height: 16px; width: 16px; }​ #no { backg ...

Executing a JavaScript function on an HTML page within an embedded object tag

I am facing a scenario where I have a page with another page embedded using an object tag. The challenge is to call a JavaScript function from the "parent" page, specifically reaching a function within the embedded code. In the past, my solution involved ...

Guide to developing JavaScript code that moves information from one local website to a different one

Here's the scenario: You input text into a field on website A and click a button. Upon clicking that button, the entered text should appear in website B. I attempted to use localStorage for this functionality, but unfortunately it was not successful. ...

The `required` attribute is ineffective when used with the `<form>` element

My required attribute isn't enforcing mandatory field completion before form submission. HTML Code: <!-- Modal Content --> <form class="modal-content2"> <div class="container3"> < ...

Each click on Named Window in window.open results in the opening of a new window

Whenever I use window.open() to launch a new window, clicking the button creates a new browser instance each time, even if the function specifies a named window. <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> &l ...

When utilizing React, I generated an HTML page with a distinct .js file, however, encountered two unexpected errors

Update : Gratitude to everyone who has helped me in tackling this issue. One user suggested using a web server, but my intention was to find a solution using just a single HTML and JS file. Even though I tried following the steps from a similar question o ...

How can Django display HTML content verbatim without needing a variable?

I have a collection of HTML code: <div align="center" id="whatever"> <a href="http://www.whatever.com" style="text-decoration:none;color:black"> <img src="http://www.whatever.com/images/whatever.jpg" /> </a></div> I am look ...

Add some styling to the dropdown option element using CSS

My dropdown menu appears like this:- <select id="fruits"> <option value="-1">Select</option> <option value="1">Banana</option> <option value="2">Apple</option> <option value="3">Grapes</op ...

When using Wamp server, the PHP file may be displayed as code without being executed

I need help accessing HTML data in a PHP file to add two numbers. Here is the HTML code for capturing user input: addnumber.html <html> <head> </head> <body> <form action="add.php" method="POST ...

Unable to get the DIV to float within its parent div

I'm having an issue with 2 DIV elements (the ones labeled "Module" below) not behaving as expected! When I try to float them so they appear side by side, they end up jumping outside of the parent container and falling below it. I've tried to trou ...

Differences between Umbraco CSS and image file paths

As I embark on creating a new website using Umbraco(version 6.1.1 with razor), I find myself in unfamiliar territory as a newcomer to the world of Umbraco. My settings panel currently appears like this: Within my Master template, I have implemented my CSS ...

Gatsby causing issues with Material UI v5 server side rendering CSS arrangement

I shared my problem on this GitHub issue too: https://github.com/mui-org/material-ui/issues/25312 Currently, I'm working with the Gatsby example provided in Material UI v5: https://github.com/mui-org/material-ui/tree/next/examples/gatsby After imple ...

Creating a table-like structure in HTML using `<div>` elementsWould you like to

I am looking to design a basic HTML page with a menu bar on the left side occupying 17% of the width, and content on the right side occupying 83% of the width. Below is the HTML code I have constructed: .row { display: block; } .cell { padding: 0; ...

What is preventing simple HTML DOM Parser from traversing certain websites?

Query: After adding error_reporting(-1); I encountered the following error: Notice: Trying to access a property of a non-object in /data/22/2/145/126/2960289/user/3282682/htdocs/add.php on line 106 Notice: Undefined offset: 0 in /data/22/2/145/126/296028 ...

Why is my Angular form submitting twice?

Currently, I am working on a user registration form using AngularJS with ng-submit and ng-model. However, I am facing an issue where the form triggers submission twice when the user submits it. I have checked for common causes such as declaring the contro ...

I am in search of a specialized 3D camera with a unique effect

I am seeking assistance with animating a camera to replicate or closely resemble the effect seen in this demo: Any help would be greatly appreciated. ...

Steps for positioning the scroll-thumb in the middle of the scrollbar

Currently, I am working on a react application and facing an issue while trying to display images with custom zoom-in/zoom-out functionality. Due to the need to add markers to each image that require precise positioning, using a pre-existing library for zo ...

Creating a specific type of table using Ruby on Rails

Is it feasible to create a table with two columns, where the left column incorporates multiple rows with a scroll bar, and the right column contains a large box housing buttons that alter based on the selection of blocks in the left column? ...

"Troubleshooting a Animation Problem in the Latest Version of

I have discovered an issue with animations on the latest version of Firefox Quantum. Upon loading a page with certain animated elements set to display: none;, when a script changes it to .display = "block";, some parts of the animation may be missed or no ...