cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              a.tag.tag-default> [href='#!'] lorem ipsum
a.tag.tag-blue> [href='#!'] lorem ipsum
a.tag.tag-green> [href='#!'] lorem ipsum
a.tag.tag-red> [href='#!'] lorem ipsum
a.tag.tag-default> [href='#!'] 
  span Lorem ipsum dolor sit amet, consectetur adipisicing elit. Necessitatibus deserunt eligendi neque soluta, fuga nulla quam omnis nobis earum quasi, in voluptatem odit cum inventore dolorum! Necessitatibus labore obcaecati saepe!
span.tag.tag-default> 
  span lorem ipsum dalor gamut
            
          
!
            
              @import "compass/css3";

$font-size: 12px;
$tag-height: $font-size + 10;
$border-width: 1px;
$border-radius: 3px;
$page-bg: mediumspringgreen;
$hole-size: floor($font-size *.4);

.tag {
  $corner-cut: sqrt(2 * pow($border-radius, 2)) - $border-radius;
  $corner-length: sqrt((pow($tag-height + (2 * $corner-cut), 2)) / 2) - .1;
  
  display: inline-block;
  border: $border-width solid;
  border-radius: $border-radius;

  height: $tag-height;
  max-width: 100%;
  padding: 0.1em 0.5em 0.2em ($tag-height / 2 + $corner-cut);
  margin-bottom: .25em;
  margin-left: $tag-height / 2;
  box-sizing: border-box;
  position: relative;
  
  font-size: $font-size;
  white-space: nowrap;
  text-decoration: none;
  vertical-align: baseline;
  
  span {
    display: inline-block;
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
  }

  // corner
  &:before {
    
    content: '';
    display: inline-block;
    
    border-radius: $border-radius;
    border-bottom-left-radius: $border-radius + 1;
    border-color: inherit;
    border-left:   $border-width * 1.25 solid;
    border-bottom: $border-width * 1.2 solid;
    background-color: inherit;
    
    height: $corner-length;
    width:  $corner-length;
    box-sizing: border-box;
    position: absolute;
    top: -1 * $border-width - $corner-cut;
    left: floor($corner-cut);
    z-index: 2;
    
    @include transform-origin(left, top);
    @include transform(rotate(45deg));
  }
  
  // hole
  &:after {
    content: '';
    display: block;
    background-color: $page-bg;
    border-radius: 100%;
    border: 1px solid;
    height: $hole-size;
    width: $hole-size;
    
    position: absolute;
    left: -1 * ($hole-size / 2) + 3;
    top: ($tag-height / 2) - ($hole-size / 2) - $border-width;
    z-index: 3;
  }
}

@mixin tag-variant($background, $color, $border-color: darken($background, 15%)) {
  background-color: $background;
  color: $color;
  &, &:before, &:after { border-color: $border-color; }
  
  // link hover
  &[href], .hover {
    &:hover, &:focus {
      background-color: darken($background, 10%);
      &, &:before, &:after { border-color: darken($border-color, 10%); }
    }
  }
}
.tag-default {
  @include tag-variant(#EEE, #666);
}
.tag-blue {
  @include tag-variant(#ACF, #118);
}
.tag-green {
  @include tag-variant(#BEB, #161, #4B4);
}
.tag-red {
  @include tag-variant(#EBB, #611);
}

body { font-family: "Avenir Next", 'Open Sans', sans-serif; padding: 2em; background: $page-bg;}
            
          
!
999px
Loading ..................

Console