Skip to content

Instantly share code, notes, and snippets.

@ar-android
Created July 30, 2019 07:11
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 ar-android/a55ca7306deeea91828eb7b668ff6a06 to your computer and use it in GitHub Desktop.
Save ar-android/a55ca7306deeea91828eb7b668ff6a06 to your computer and use it in GitHub Desktop.
Simple css ribbon
<html>
<head>
<meta charset="UTF-8">
<title>CSS Ribbon</title>
<style>
.container {
margin: 0 auto;
width: 800px;
}
.ribbon{
font-size: 16px !important;
font-weight: 100;
font-family: Arial, Helvetica, sans-serif;
width: 50%;
position: relative;
background: #794acf;
color: white;
text-align: center;
padding: 1em 2em;
margin: 2em auto 3em;
}
.ribbon:before, .ribbon:after {
content: "";
position: absolute;
display: block;
bottom: -1em;
border: 1.5em solid #794acf;
z-index: -1;
}
.ribbon:before {
left: -2em;
border-right-width: 1.5em;
border-left-color: transparent;
}
.ribbon:after {
right: -2em;
border-left-width: 1.5em;
border-right-color: transparent;
}
.ribbon .ribbon-content:before, .ribbon .ribbon-content:after {
content: "";
position: absolute;
display: block;
border-style: solid;
border-color: #794acf transparent transparent transparent;
bottom: -1em;
}
.ribbon .ribbon-content:before {
left: 0;
border-width: 1em, 0, 0,1em;
}
.ribbon .ribbon-content:after {
right: 0;
border-width: 1em, 1em, 0, 0;
}
</style>
</head>
<body>
<div class="container">
<h1 class="ribbon">
<strong class="ribbon-content">
Selamat kamu menang!
</strong>
</h1>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment