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="section">
  <div class="thumbnail">
    
  </div>
  <div class="tar">
    <a href="javascript:;" class="like btn-trigger">
      <img src='data:img/jpg;base64,iVBORw0KGgoAAAANSUhEUgAAAIkAAACJCAYAAAAYJBvJAAAAAXNSR0IArs4c6QAACGRJREFUeAHt
nVvIFVUYhn/LlOwk5ik7aFkRFJTWRRcdIKNIyMKsKCi9MIgwBEO7qYxOFx3BgtKolIq8SLIizUj8
zSJFi05WUppakaZlhXRU7H23e4b1z57j3rNnZs16P/j+Oaw1a77vWe+/5rBnz+7pkYmACIiACIiA
CIiACIiACIiACIiACIiACIiACIiACORDoF8+zbTdypHY8hj44Kb3D7S0FcvbAuvqujgaiY0JJLcP
y781/XdM9wbKC1ksUiSnIKML4OPg45tOkSTZAVTY2vTFmC6F/wy32UYh+MlNH4MpPU1f/IF66+Ab
4F/A18K3wK22YxH9NPgS+L9wdngevgztTIefBLfFxiLQ2fDV8DwYsA0yJdtp8CFwq+w8RPs4fAc8
LyBR7byJfcyAj4BXzUYioJnwd+BR8ee1nqzJnOwrbRMQ3avwvBLP0s427Jf/qYPgZRtjmANnTFly
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rEBM+lGpEgQRt8u7
KiQU3v9o98WFcTmqLAcCU9DGD/AyR5WZOeShJrpM4Cy0z1/JLloo32CfE7ucm5rPkUB/tPUkvCih
8CFlPuYgs5AADz/vw7sllo1o+zYLuSjkEAK3Y12et/T5vAs/ezkiZF9aZTGB4YidN7XWwNsdWfh9
IQpuBNwJS/NDjXUFwc9ProXzZ1mOb3rwknU/1v/YdD7zsQT+Ldwpc1kkYR09EitHNQsojp1hlbRO
BERABERABERABERABERABERABERABERABERABEIJ/A9LD4T/ZENHvwAAAABJRU5ErkJggg=='/>
</a>

  </div>
</div>
<div class="section">
  <div class="thumbnail">
    
  </div>
  <div class="tar">
    <a href="javascript:;" class="like btn-trigger">
 <img src='data:img/jpg;base64,iVBORw0KGgoAAAANSUhEUgAAAIkAAACJCAYAAAAYJBvJAAAAAXNSR0IArs4c6QAACGRJREFUeAHt
nVvIFVUYhn/LlOwk5ik7aFkRFJTWRRcdIKNIyMKsKCi9MIgwBEO7qYxOFx3BgtKolIq8SLIizUj8
zSJFi05WUppakaZlhXRU7H23e4b1z57j3rNnZs16P/j+Oaw1a77vWe+/5rBnz+7pkYmACIiACIiA
CIiACIiACIiACIiACIiACIiACIiACORDoF8+zbTdypHY8hj44Kb3D7S0FcvbAuvqujgaiY0JJLcP
y781/XdM9wbKC1ksUiSnIKML4OPg45tOkSTZAVTY2vTFmC6F/wy32UYh+MlNH4MpPU1f/IF66+Ab
4F/A18K3wK22YxH9NPgS+L9wdngevgztTIefBLfFxiLQ2fDV8DwYsA0yJdtp8CFwq+w8RPs4fAc8
LyBR7byJfcyAj4BXzUYioJnwd+BR8ee1nqzJnOwrbRMQ3avwvBLP0s427Jf/qYPgZRtjmANnTFly
yKsu+4B9USkbjmio4ryS7KSdzxHHrSXS4b55vtBJDnltyz4ZViILf9c3YG4TPK/E8mrnFcR0sh9l
92d4Yr4Ynlf8ebXzNWK6ufvpR+/hzgpCMeFuRnzXR4efWwn3wX2Z+67a/PO5ZZuhofUVh2J20kMZ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4YidN7XWwNsdWfh9
IQpuBNwJS/NDjXUFwc9ProXzZ1mOb3rwknU/1v/YdD7zsQT+Ldwpc1kkYR09EitHNQsojp1hlbRO
BERABERABERABERABERABERABERABERABERABEIJ/A9LD4T/ZENHvwAAAABJRU5ErkJggg=='/>
</a>

  </div>
</div>
<div class="section">
  <div class="thumbnail">
    
  </div>
  <div class="tar">
    <a href="javascript:;" class="like btn-trigger">
  <img src='data:img/jpg;base64,iVBORw0KGgoAAAANSUhEUgAAAIkAAACJCAYAAAAYJBvJAAAAAXNSR0IArs4c6QAACGRJREFUeAHt
nVvIFVUYhn/LlOwk5ik7aFkRFJTWRRcdIKNIyMKsKCi9MIgwBEO7qYxOFx3BgtKolIq8SLIizUj8
zSJFi05WUppakaZlhXRU7H23e4b1z57j3rNnZs16P/j+Oaw1a77vWe+/5rBnz+7pkYmACIiACIiA
CIiACIiACIiACIiACIiACIiACIiACORDoF8+zbTdypHY8hj44Kb3D7S0FcvbAuvqujgaiY0JJLcP
y781/XdM9wbKC1ksUiSnIKML4OPg45tOkSTZAVTY2vTFmC6F/wy32UYh+MlNH4MpPU1f/IF66+Ab
4F/A18K3wK22YxH9NPgS+L9wdngevgztTIefBLfFxiLQ2fDV8DwYsA0yJdtp8CFwq+w8RPs4fAc8
LyBR7byJfcyAj4BXzUYioJnwd+BR8ee1nqzJnOwrbRMQ3avwvBLP0s427Jf/qYPgZRtjmANnTFly
yKsu+4B9USkbjmio4ryS7KSdzxHHrSXS4b55vtBJDnltyz4ZViILf9c3YG4TPK/E8mrnFcR0sh9l
92d4Yr4Ynlf8ebXzNWK6ufvpR+/hzgpCMeFuRnzXR4efWwn3wX2Z+67a/PO5ZZuhofUVh2J20kMZ
8spada5FHAq9XOb1utkJNswvytr7KerbJBCvjwq5x1TF8w8PQNJ0ZYqOT1tlASom7a+q5e+lTbKd
eqssBuN12Ip2Eg9s01sDDs8Gcspl8eUagPGEMq8DIhSZ147t00c64NCy6aM1AuN17D0tWSaveKGG
HO5LT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a>

  </div>
</div>
              
            
!

CSS

              
                
.tar{
  text-align:right;
  border-top:1px solid #ccc;
  margin-top:10px;
}
.section{
  margin-bottom:10px;
  border:1px solid #ccc;
  padding:10px;
}

.thumbnail{
  min-height:100px;
  background:#ccc;
}

.like{
  display:inline-block;
  width:10px;
  height:10px;
  line-height:0;
  img{
    width:100%;
    height:auto;
  }
}

.btn-trigger{
  position:relative;
  &::before{
    content:'';
    position:absolute;
    left:-10px;
    right:-10px;
    top:-8px;
    bottom:-8px;
    background:rgba(red,0.2);
  }
}
              
            
!

JS

              
                let btns =$('.like');
btns.on('click',function(){
  alert('Like Button Clicked~');
});
              
            
!
999px

Console