当我们想要删除悬停时的边框和框阴影时如何修复闪烁

问题描述 投票:0回答:1

问题陈述:

  1. a
    div
    有灰色边框和框阴影
  2. 任务是清除div悬停时的边框和阴影
  3. 我们通过
    border:none
    box-shadow:none
  4. 摆脱它们
  5. 出现闪烁

HTML:


<div id="test"></div>

CSS:

#test{
  border:2px gray solid;
  box-shadow:0px 0px 5px 0px gray;
  width:160px;
  height:100px; background:url('http://www.w3.org/2008/site/images/logo-w3c-screen-lg')
}

#test:hover{
  box-shadow:none;
  border:none;
}
css border
1个回答
0
投票

使用

border-color:transparent
代替
border:none

#test:hover{
  box-shadow:none;
  border-color:transparent;
}
© www.soinside.com 2019 - 2024. All rights reserved.