您现在的位置: 万盛学电脑网 >> 程序编程 >> 网页制作 >> DivCSS教程 >> 正文

巧用CSS3 border实现图片遮罩效果代码

作者:佚名    责任编辑:admin    更新时间:2022-06-22

代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>无标题文档</title> 
<style type="text/css"> 
.trans { 
-webkit-transition: 0.3s ease; 
-moz-transition: 0.3s ease; 
-ms-transition: 0.3s ease; 
-o-transition: 0.3s ease; 
transition: 0.3s ease; 

.test_outer { 
display: block; 
width: 200px; 
height: 200px; 
margin: 1em auto; 
position: relative; 
overflow: hidden; 

.test_cover { 
width: 40px; 
height: 40px; 
border: 200px solid rgba(0, 0, 0, .35); 
border-radius: 50%; 
position: absolute; 
left: -115px; 
top: -165px; 

.test_cover:hover {