Skip to content

Instantly share code, notes, and snippets.

@kurrik
Created August 11, 2011 22:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurrik/1140926 to your computer and use it in GitHub Desktop.
Save kurrik/1140926 to your computer and use it in GitHub Desktop.
Renders an eyeball via CSS
<!DOCTYPE html>
<!-- Based off of the infinity symbol from http://css-tricks.com/examples/ShapesOfCSS/ -->
<html>
<head><title>CSS Eyeball</title>
<style>
#eyeball {
position: relative;
width: 140px;
height: 100px;
}
#eyeball:before,
#eyeball:after {
content: "";
position: absolute;
top: 0;
left: 20px;
width: 60px;
height: 60px;
border: 20px solid red;
-moz-border-radius: 50px 50px 0 50px;
border-radius: 50px 50px 0 50px;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
}
#eyeball:after {
-moz-border-radius: 50px 50px 50px 0;
border-radius: 50px 50px 50px 0;
-webkit-transform:rotate(45deg);
-moz-transform:rotate(45deg);
-ms-transform:rotate(45deg);
-o-transform:rotate(45deg);
transform:rotate(45deg);
}
</style>
</head>
<body><div id="eyeball"></div></body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment