Created
January 3, 2013 05:10
-
-
Save santosh/4440993 to your computer and use it in GitHub Desktop.
CSS: CSS technique to make image reflectionss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html dir="ltr" lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" type="text/css" media="screen" href="reflection.css" /> | |
<title> Image Reflection </title> | |
</head> | |
<body> | |
<img src="http://davidwalsh.name/demo/ricci-url.jpg" alt="CSS Image Reflection - Safari" width="300" class="reflectBelow" /> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
text-align: center; | |
} | |
.reflectBelow { | |
-webkit-box-reflect:below 0px | |
-webkit-gradient(linear, left top, left bottom, from(transparent), | |
color-stop(0.5, transparent), to(white)); | |
} | |
.reflectAbove { | |
-webkit-box-reflect:above 20px | |
-webkit-gradient(linear, left top, left bottom, from(transparent), | |
color-stop(0.5, transparent), to(white)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment