以下代码将用于教育目的。它只是简单地演示了如何使用CSS3过滤器应用下拉阴影。对于我没有使用最佳实践的领域,任何反馈都将是很棒的。
JSBin
<!DOCTYPE HTML>
<html>
<head>
<title>Drop Shadow</title>
<link rel="stylesheet" type="text/css" href="drop-shadow.css">
</head>
<body>
<!-- Introduction to the text shadow property -->
<div class="container one">
<img width="250" height="250" src="http://iancottam.co.uk/img/footy.png">
</div>
<div class="container two">
<img width="250" height="250" src="http://iancottam.co.uk/img/footy.png">
</div>
<!-- Support Info: http://caniuse.com/css-filters -->
</body>
</html> body{
background: #ccc;
margin: 0;
}
h1{
font-size: 5em;
font-family: Georgia;
}
.container{
padding: 20px 50px;
}
.one img{
-webkit-filter: drop-shadow(0 0 30px black);
}
.two{
background: black;
}
.two img{
-webkit-filter: drop-shadow(-15px 0px 20px white);
}发布于 2014-02-19 18:52:28
你的代码--很好
我只想改变一下,强调图像是一样的:
.container img {
width: 250px;
height: 250px;
content: url("http://iancottam.co.uk/img/footy.png");
}然后
<div class="container one">
<img>
</div>
<div class="container two">
<img>
</div>吉斯宾
https://codereview.stackexchange.com/questions/42173
复制相似问题