Skip to content

Instantly share code, notes, and snippets.

@clohr
Created April 19, 2017 15:16
Show Gist options
  • Save clohr/fd40f8e8748cbbcaeeef1f5cf69fe241 to your computer and use it in GitHub Desktop.
Save clohr/fd40f8e8748cbbcaeeef1f5cf69fe241 to your computer and use it in GitHub Desktop.
CSS Menu Carets
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style>
.arrow {
top: 50px;
display: block;
position: relative;
width: 300px;
height: 150px;
border: solid 1px #ddd;
background: white;
padding: 15px;
}
.arrow::before, .arrow::after {
position: absolute;
bottom: 100%;
left: 10%;
content: " ";
width: 0px;
height: 0px;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
}
.arrow::before {
border-bottom: 20px solid #333;
z-index: 1;
}
.arrow::after {
border-bottom: 20px solid white;
z-index: 2
}
</style>
</head>
<body>
<div class="arrow">This is some stuff.</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment