Box with ribbon

CSS3 box

by toubia95

HTML

<div>Hello World!</div>

CSS

body {
  font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  padding: 100px;
  font-size: 13px;
}

div {
  background: #fff;
  margin: 0 auto;
  width: 200px;
  padding: 100px;
  text-align: center;

  /* border-radius */
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  border-radius: 5px;

  /* box-shadow */
  -webkit-box-shadow: rgba(0,0,0,0.2) 0px 1px 3px;
  -moz-box-shadow: rgba(0,0,0,0.2) 0px 1px 3px;
  box-shadow: rgba(0,0,0,0.2) 0px 1px 3px; 

  position: relative;
  overflow: hidden;
}

div::after {
  content:"CSS of the day !";
  padding: 2px 50px;
  position: absolute;
  display: block;
  top: 30px;
  right: -50px;
  color: white;
    
  -moz-transform:rotate(45deg);
  -webkit-transform:rotate(45deg);
  transform:rotate(45deg);
    
  font-size: 10px;
  font-weight: bold;
    
  -webkit-box-shadow: 0px 1px 2px 0px #999; 
  -moz-box-shadow: 0px 1px 2px 0px #999; 
  box-shadow: 0px 1px 2px 0px #999;
    
  background: #d10404; /* Old browsers */
  background: -moz-linear-gradient(left,  #d10404 0%, #a30000 100%); /* FF3.6+ */
  background: -webkit-gradient(linear, left top, right top, color-stop(0%,#d10404), color-stop(100%,#a30000)); /* Chrome,Safari4+ */
  background: -webkit-linear-gradient(left,  #d10404 0%,#a30000 100%); /* Chrome10+,Safari5.1+ */
  background: -o-linear-gradient(left,  #d10404 0%,#a30000 100%); /* Opera 11.10+ */
  background: -ms-linear-gradient(left,  #d10404 0%,#a30000 100%); /* IE10+ */
  background: linear-gradient(left,  #d10404 0%,#a30000 100%); /* W3C */
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#d10404', endColorstr='#a30000',GradientType=1 ); /* IE6-9 */

  -webkit-box-shadow: inset 0px 0.5px 1px #fff; 
  -moz-box-shadow: inset 0px 0.5px 1px #fff; 
  box-shadow: inset 0px 0.5px 1px #fff; 

  border: 1px dashed #fff;
  outline: 1px solid #d10404;
}