Created
January 23, 2012 10:04
-
-
Save vindia/1662280 to your computer and use it in GitHub Desktop.
Venn Diagram in HTML and CSS
This file contains 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> | |
<title>A Venn Diagram in HTML and CSS</title> | |
<style> | |
div { | |
float: left; | |
width: 100px; | |
height: 100px; | |
border-radius: 50px; | |
color: #fff; | |
text-align: center; | |
vertical-align: middle; | |
font-size: 1em; | |
line-height: 100px; | |
text-transform: uppercase; | |
font-weight: bold; | |
font-family: sans-serif; | |
position: relative; | |
} | |
.one { background-color: blue; } | |
.two::before{ content: 'c'; position: absolute; left: 10px } | |
.two { background-color: rgba(255,0,0,0.5); margin-left: -30px; } | |
</style> | |
<div class="one">a</div> | |
<div class="two">b</div> | |
<!-- | |
See it in action at http://jsfiddle.net/RefGM/1/ | |
Thx to Arjan Eising for some positioning hints | |
--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment