首页 > 解决方案 > 当我在 img 标签中使用类属性时,我看到边框也随之显示。如何消除边框

问题描述

我对图像使用 CSS 类。当我在 img 标签中使用 CSS 类时,我看到图像周围有边框。附上截图。我看到这张图片周围的边框

在此处输入图像描述

实际图片应该是这样的

在此处输入图像描述

这是CSS:

.bigDropArrow {
  background-image: url(/assets/images/bigdroparrow.png)!important;
  height: 35px;
  width: 91px;
  display: block;
  background-repeat: no-repeat;
  padding-bottom: -32px;
  padding-right: -9px;
  margin-left: 213px;
  margin-top: -90px;
  z-index: 1000;
border:0;
}

这是html:

 <img class="bigDropArrow" alt="">

标签: htmlcssangularimage

解决方案


我认为 :focus 或 :active 中的问题尝试添加并且您没有 src=" atttribute"

img {outline : none;}

或者

img:focus {outline : none;}
img:active {outline : none;}

推荐阅读