在标签内插入图片
        并运行它可能有助于充分理解
         清楚地



.focus {
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
}
.focus:hover {
border: 70px solid #000;
border-radius: 50%;
}

<div class="focus pic"><img src=" " ></div>

最佳答案

首先设置缩小时应在其上显示的元素的默认值。

:hover条件下,第二个将过渡效果设置为0。



.focus {
  -webkit-transition: all 1s ease;
  -moz-transition: all 1s ease;
  -o-transition: all 1s ease;
  -ms-transition: all 1s ease;
  border: 0px solid #000;
  border-radius: 0;
}
.focus:hover {
  -webkit-transition: all 0s ease;
  -moz-transition: all 0s ease;
  -o-transition: all 0s ease;
  -ms-transition: all 0s ease;
  border: 70px solid #000;
  border-radius: 50%;
}

<div class="focus pic">
  <img src="http://www.w3schools.com/html/pic_mountain.jpg">
</div>

关于javascript - 我如何尝试用边框半径显示焦点的效果。我希望它缩小,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/38823036/

10-12 12:26