在标签内插入图片 并运行它可能有助于充分理解 清楚
.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/