Pure CSS tricks

stitched_elements_css

Some cool techniques that are available in pure CSS. Check them out!

Stiched elements in CSS3

stitched_elements_css_stitched

p {
	padding: 5px 10px;
	margin: 10px;
	background: #ff0030;
	color: #fff;
	font-size: 21px;
	line-height: 1.3em;
	border: 2px dashed #fff;
	border-radius: 3px;
	-moz-border-radius: 3px;
	-webkit-border-radius: 3px;
	-moz-box-shadow: 0 0 0 4px #ff0030, 2px 1px 4px 4px rgba(10,10,0,.5);
	-webkit-box-shadow: 0 0 0 4px #ff0030, 2px 1px 4px 4px rgba(10,10,0,.5);
	box-shadow: 0 0 0 4px #ff0030, 2px 1px 6px 4px rgba(10,10,0,.5);
	text-shadow: -1px -1px #aa3030;
}

Demo

Pure CSS corner ribbon

stitched_elements_css_ribbbon

.wrapper {
  margin: 50px auto;
  width: 280px;
  height: 370px;
  background: white;
  border-radius: 10px;
  -webkit-box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
  position: relative;
  z-index: 90;
}

.ribbon-wrapper-green {
  width: 85px;
  height: 88px;
  overflow: hidden;
  position: absolute;
  top: -5px;
  right: -5px;
}

.ribbon-green {
  font-weight: bold;
  font-family: Sans-Serif;
  color: #333;
  font-size: 15px;
  text-align: center;
  text-shadow: white 0px 1px 0px;
  -webkit-transform: rotate(45deg);
  position:relative;
  padding:7px 0 ;
  left: -5px;
  top: 15px;
  width: 120px;
  background: -webkit-gradient(linear, left top, left bottom, from(#BFDC7A), to(#8EBF45));
  color:#6a6340;
  box-shadow: 0px 0px 3px 2px rgba(0,0,0,0.3);
}

.ribbon-green:before, .ribbon-green:after {
  content: "";
  /* Colour of the triangle. To flip the effect, use border-bottom. */
  border-top: 3px solid #6e8900;   
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  position:absolute;
  bottom: -3px; /* +1 to compensate for the border */
}

.ribbon-green:before {
  left: 0px;
}
.ribbon-green:after {
  right: 0px;
}

Demo

Thanks to: