Remove default border around image - Chrome browser


Zach

I can't believe it's the first time I've encountered this problem. I've searched many other similar questions on SO regarding the same issue, but none of them worked for me.

I have an img tag with a class attribute under the anchor tag.

So my html looks like:

<ul id="racing-menu" class="accordion-menu list-unstyled">
  <li>
    <a id"something" name class"something">
      <img class="icon_71">
    </a>
  </li>
</ul>

CSS

.icon_71 {
  background: url(../../cms/images/sports/something.png) no-repeat;
  width: 36px;
  height: 22px;
  margin: 0 10px 0 0;
  float: left;
}

I tried the following solutions to avoid the default border on Chrome

1) Boundary: 0 2) Contour: None 3) Change img class to img id

4) Setting

a img {
  border:none
} 

a img {
  border:0
}
Eastway

Your <img>tag doesn't have an srcattribute because you're setting the background using CSS.

<img class="icon_406">

This is invalid html - if you intend to implement icons via css using <span>or similar means that don't require srcspec-specified properties . Or load an image icon via the element's srcattribute <img>.

Chrome shows the border because it can't find the image (like if the internal link is broken) - but the icon is shown srcbecause CSS is still able to apply class styles to empty <img>elements .

Related


Remove border around circular image

John Du I have a circular image (.png file) with transparency in the middle. I need to make the background inside the image a solid color. For this I make the background solid and put in border-radius:50%, but this produces ugly little white lines. Is there an

Remove border around circular image

John Du I have a circular image (.png file) with transparency in the middle. I need to make the background inside the image a solid color. For this I make the background solid and put in border-radius:50%, but this produces ugly little white lines. Is there an

Remove border around circular image

John Du I have a circular image (.png file) with transparency in the middle. I need to make the background inside the image a solid color. For this I make the background solid and put in border-radius:50%, but this produces ugly little white lines. Is there an

Remove border around image in Pygame

username I have some surfaces in Pygame with transparent backgrounds. They are all the same size. But there is a different sized circle on each pixel, so the circle doesn't exactly fit the image. Here are some sample images (I took screenshots in Photoshop so

How to remove the image around the border

Edwin So I have a question. I used sprites for the first time and now borders appear around them, I tried setting border: none, but it didn't work. demo <div class="service"> <img href="image/icons.png" style="background-image:url('image/icons.png'); backgroun

Remove border around circular image

John Du I have a circular image (.png file) with transparency in the middle. I need to make the background inside the image a solid color. For this I make the background solid and put in border-radius:50%, but this produces ugly little white lines. Is there an

Remove border around circular image

John Du I have a circular image (.png file) with transparency in the middle. I need to make the background inside the image a solid color. For this I make the background solid and put in border-radius:50%, but this produces ugly little white lines. Is there an

Remove border around circular image

John Du I have a circular image (.png file) with transparency in the middle. I need to make the background inside the image a solid color. For this I make the background solid and put in border-radius:50%, but this produces ugly little white lines. Is there an

Remove border around circular image

John Du I have a circular image (.png file) with transparency in the middle. I need to make the background inside the image a solid color. For this I make the background solid and put in border-radius:50%, but this produces ugly little white lines. Is there an

Remove border around image in Pygame

username I have some surfaces in Pygame with transparent backgrounds. They are all the same size. But there is a different sized circle on each pixel, so the circle doesn't exactly fit the image. Here are some sample images (I took screenshots in Photoshop so

How to remove the image around the border

Edwin So I have a question. I used sprites for the first time and now borders appear around them, I tried setting border: none, but it didn't work. demo <div class="service"> <img href="image/icons.png" style="background-image:url('image/icons.png'); backgroun

Blue border around image in Chrome on Ubuntu 18.04

AbdElraouf Sabri I have weird blue borders around images on google chrome, see your self AbdElraouf Sabri I disabled Chrome hardware acceleration and that fixed the issue for me . pace chrome://settingsType in the address bar at the top of Chrome . Alternative

Strange border around arrow image, how to remove it?

principal fund I'm using slick sliders for our team carousel. There is a weird border around the arrow image to click on the next slide. I've tried removing all CSS that affects arrow images, google searches, stack overflow, etc. How can I remove this border?

How can I remove the border around the image?

username How can I remove the border around the square? Exterior: my HTML: <input id="black" type="image" src="html5-canvas-drawing-app/images/color-swatch-brown.png" onClick="changeColorBlack()"> my css: #black{ border:none; outline:none; background:none; pa

Strange border around arrow image, how to remove it?

principal fund I'm using slick sliders for our team carousel. There is a weird border around the arrow image to click on the next slide. I've tried removing all CSS that affects arrow images, google searches, stack overflow, etc. How can I remove this border?

Strange border around arrow image, how to remove it?

principal fund I'm using slick sliders for our team carousel. There is a weird border around the arrow image to click on the next slide. I've tried removing all CSS that affects arrow images, google searches, stack overflow, etc. How can I remove this border?

remove border around dash

Formenti Matteo I want to remove the huge dotted border around the dash in Ubuntu 16.04. Google hasn't been my friend lately, I just can't find any results... Compizconfig doesn't contain any options for this. Can someone help me? More than There is no setting

remove border around dash

Formenti Matteo I want to remove the huge dotted border around the dash in Ubuntu 16.04. Google hasn't been my friend lately, I just can't find any results... Compizconfig doesn't contain any options for this. Can someone help me? More than There is no setting

How to remove the default favicon of Chrome browser?

SP Is it possible to remove Google Chrome's default favicon such as the following: I found an article saying it has to do with the security of the website connection. Can I remove it using javascript code, or can I upload a transparent icon to disguise it? Ron

Unable to remove default top margin of chrome browser

User 1556433 After many attempts, I can't remove the default top margin. Below is my HTML and CSS code. Please suggest where I am missing? HTML file <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <link rel="stylesheet" type=

How to remove the default favicon of Chrome browser?

SP Is it possible to remove Google Chrome's default favicon such as the following: I found an article saying it has to do with the security of the website connection. Can I remove it using javascript code, or can I upload a transparent icon to disguise it? Ron

How to remove white border around image in mobile view?

ZACK_G In my blog post, I uploaded some images and used CSS code to remove the white box borders that formed around the images on the desktop version. But I can't remove the white box border formed around the image in the mobile version. Suggest any suitable s

How to remove white border around image in mobile view?

ZACK_G In my blog post, I uploaded some images and used CSS code to remove the white box borders that formed around the images on the desktop version. But I can't remove the white box border formed around the image in the mobile version. Suggest any suitable s

How to remove white border around image in mobile view?

ZACK_G In my blog post, I uploaded some images and used CSS code to remove the white box borders that formed around the images on the desktop version. But I can't remove the white box border formed around the image in the mobile version. Suggest any suitable s

How to remove white border around image in mobile view?

ZACK_G In my blog post, I uploaded some images and used CSS code to remove the white box borders that formed around the images on the desktop version. But I can't remove the white box border formed around the image in the mobile version. Suggest any suitable s

How to remove white border around image in mobile view?

ZACK_G In my blog post, I uploaded some images and used CSS code to remove the white box borders that formed around the images on the desktop version. But I can't remove the white box border formed around the image in the mobile version. Suggest any suitable s

How to remove white border around image in mobile view?

ZACK_G In my blog post, I uploaded some images and used CSS code to remove the white box borders that formed around the images on the desktop version. But I can't remove the white box border formed around the image in the mobile version. Suggest any suitable s