Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="demo">
  Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rem explicabo nam, nisi soluta dicta voluptates,

  <!-- The thing -->
  <a href="https://google.com" target="_blank">go to google.com</a>
  <!-- End the thing -->

  sequi magnam delectus nihil sint labore recusandae dolor quas. Voluptate magni beatae recusandae rem explicabo <a href="https://google.com">link without target="_blank"</a> rem explicabo nam, nisi soluta dicta voluptates.
</div>

<!-- Meta -->
<span class="author">A CodePen by <a href="https://twitter.com/XereoAntariano" target="_blank">@XereoAntariano</a></span>
<span class="title">Simple, UX friendly pure-css links that open in a new tab</span>
              
            
!

CSS

              
                // Pure CSS link style with nice UX-friendly
// notice all in one element :)
// ===============================================
@color: rgb(33, 150, 243);
a {
  display: inline-block;
  color: @color;
  transition: all .2s ease;
  background-color: transparent;
  text-decoration: none;
  padding: .1em;
  position: relative;
  z-index: 10;
  &:before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 1%;
    border-bottom: 1px dotted @color;
    background-color: transparent;
    transition: all .3s ease;
    z-index: -1;
  }
  &:hover {
    text-decoration: none;
    color: #fff;
    &:before {
      height: 100%;
      background-color: @color;
    }
  }
  &[target="_blank"] {
    &:after {
      content: '[Opens in new tab]';
      position: absolute;
      top: 100%;
      font-style: italic;
      left: 0;
      transform: translateY(-100%);
      background: @color;
      width: 100%;
      text-align: center;
      height: 16px;
      font-size: 11px;
      line-height: 12px;
      transition: all .2s ease-out;
      color: fade(#fff, 85%);
      opacity: 0;
      z-index: -1;
      pointer-events: none;
    }
    &:hover:after {
      transform: translateY(0);
      opacity: 1;
    }
  }
}

// Demo styles, move up!
// ===============================================
body,
html {
  height: 100%;
  width: 100%;
  color: #444;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 23px;
}

.author {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 12px;
  color: #666;
}

.title {
  position: absolute;
  top: 15px;
  left: 15px;
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
}

.demo {
  width: 400px;
  text-align: justify;
}

              
            
!

JS

              
                
              
            
!
999px

Console