Skip to content

Instantly share code, notes, and snippets.

@johnlewisdesign
Last active July 3, 2020 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnlewisdesign/d52d0d135104c31625ef132383e0d772 to your computer and use it in GitHub Desktop.
Save johnlewisdesign/d52d0d135104c31625ef132383e0d772 to your computer and use it in GitHub Desktop.
A Yin Yang in pure css
#yin-yang {
width: 96px;
box-sizing: content-box;
height: 48px;
background: #eee;
border-color: red;
border-style: solid;
border-width: 2px 2px 50px 2px;
border-radius: 100%;
position: relative;
}
#yin-yang:before {
content: "";
position: absolute;
top: 50%;
left: 0;
background: #eee;
border: 18px solid red;
border-radius: 100%;
width: 12px;
height: 12px;
box-sizing: content-box;
}
#yin-yang:after {
content: "";
position: absolute;
top: 50%;
left: 50%;
background: red;
border: 18px solid #eee;
border-radius: 100%;
width: 12px;
height: 12px;
box-sizing: content-box;
}
<html>
<head>
<title="Yin Yang pure CSS">
</head>
<body><div id="yin-yang">&nbsp;</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment