Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.