Last active
December 16, 2015 22:49
-
-
Save desmondhume/5510040 to your computer and use it in GitHub Desktop.
Example of pure css fold on top of a box.
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> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Tests</title> | |
<style> | |
.badge { | |
background: green; | |
width: 200px; | |
height: 20px; | |
position: absolute; | |
margin-left: -100px; | |
top: -10px; | |
left: 50%; | |
padding: 5px; | |
} | |
.badge:before{ | |
content: ''; | |
position: absolute; | |
width: 0px; | |
height: 0px; | |
border-bottom: 10px solid #00530c; | |
border-left: 10px solid transparent; | |
left: -10px; | |
top: 0; | |
} | |
div.content { | |
background: white; | |
border: 1px solid black; | |
padding: 20px; | |
position: relative; | |
margin-top: 100px; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="content"> | |
<div class="badge">Badge</div> | |
<p>Content</p> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment