Pen Settings

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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <div class="container">
  <h1>Twitter buttons with no iframe</h1>  
<h3>Custom Tweet button</h3>
<div class="custom-tweet-button">
  <a href="https://twitter.com/intent/tweet?url=https://codepen.io/alistairtweedie/&amp;text=Twitter buttons for mobile - no iframes yay! from @alistairtweedie&amp;via=codepen" target="_blank" alt ="Tweet this pen">
    <i class="btn-icon"></i>
    <span class="btn-text">Tweet</span>

<h3>Custom Follow button</h3>  
<div class="custom-follow-button">
  <a href="https://twitter.com/intent/user?screen_name=alistairtweedie" target="_blank" alt="Follow alistairtweedie">
    <i class="btn-icon"></i>
    <span class="btn-text">Follow @alistairtweedie</span>
  <p>Embedding Tweet and Follow buttons on responsive sites can be a bit of a touchy subject. Including them can increase page load time greatly.</p> 

  <p>By creating a custom button we have a 'lite' version for mobile devices that won't slow the page down. </p>
   <p>Some functionality of the iframed versions isn't available but anyone who really cares about seeing the tweet count is surely just in it for the ego boost! :P enjoy!</p>

              body {
  background: #f2f2f2;
  color: #555;
p {
    line-height: 1.6;
.container {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
.custom-follow-button {
  width: 200px;
  margin: 1em auto 2em;
.custom-tweet-button a,
.custom-follow-button a {
  position: relative;
  display: inline-block;
  height: 16px;
  padding: 2px;
  border: 1px solid #ccc;
  font-size: 11px;
  color: #333;
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
  font-weight: bold;
  background-color: #F8F8F8;
  background-image: -webkit-gradient(linear,left top,left     bottom,from(#FFF),to(#DEDEDE));
  background-image: -moz-linear-gradient(top,#FFF,#DEDEDE);
  background-image: -o-linear-gradient(top,#FFF,#DEDEDE);
  background-image: -ms-linear-gradient(top,#FFF,#DEDEDE);
  border: #CCC solid 1px;
  -moz-border-radius: 3px;
  -webkit-border-radius: 3px;
  border-radius: 3px;
  cursor: pointer;
  overflow: hidden;
.custom-tweet-button a:hover,
.custom-follow-button a:hover  {
  border-color: #BBB;
  background-color: #F8F8F8;
  background-image: -webkit-gradient(linear,left top,left bottom,from(#F8F8F8),to(#D9D9D9));
  background-image: -moz-linear-gradient(top,#F8F8F8,#D9D9D9);
  background-image: -o-linear-gradient(top,#F8F8F8,#D9D9D9);
  background-image: -ms-linear-gradient(top,#F8F8F8,#D9D9D9);
  background-image: linear-gradient(top,#F8F8F8,#D9D9D9);
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  box-shadow: none;
.custom-tweet-button a .btn-icon,
.custom-follow-button a .btn-icon{
  position: absolute;
  width: 16px;
  height: 13px;
  top: 50%;
  left: 3px;
  margin-top: -6px;
  background: url('https://twitter.com/favicons/favicon.ico') 1px center no-repeat;
  background-size: 13px;
.custom-tweet-button a .btn-text,
.custom-follow-button a .btn-text{
  display: inline-block;
  padding: 2px 3px 0 20px;
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.