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


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


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.


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.


                <h3>Select text in the paragraphs below and see a pop-up menu.</h3>
 <h1>The Hart and the Hunter</h1>
 <p>The Hart was once drinking from a pool and admiring the noble figure he made there.</p>
 <p>“Ah,” said he, “where can you see such noble horns as these, with such antlers! I wish I had legs more worthy to bear such a noble crown; it is a pity they are so slim and slight.”</p>
 <p>At that moment a Hunter approached and sent an arrow whistling after him.</p>
 <p>Away bounded the Hart, and soon, by the aid of his nimble legs, was nearly out of sight of the Hunter; but not noticing where he was going, he passed under some trees with branches growing low down in which his antlers were caught, so that the Hunter
  had time to come up.</p>
 <p>“Alas! alas!” cried the Hart: “We Often Despise What Is Most Useful To Us.”</p>
<template id="shareBoxTemplate"><span id="shareBox"><button></button></span></template>


                #shareBox {
    width: 30px;
    height: 30px;
    position: absolute;
#shareBox > button {
    width: 100%;
    height: 100%;
    background-color: #292A2B;
    border: none;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    background-image: url("");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 70%;
#shareBox > button::after {
	position: absolute;
	content: '';
	border-top: 10px solid #292A2B;
	border-left:10px solid transparent;
	border-right: 10px solid transparent;
	left: 5px;
	top: 30px;	
  width: 400px;
  margin: auto;
  font-size: 14pt;
  text-align: center;
  background-color: teal;
  color: white;
  padding: 5px 0;
  font-weight: 400;


                document.addEventListener('mousedown', onMouseDown);
document.addEventListener('mouseup', onMouseUp);
var temp = document.querySelector('#shareBoxTemplate');

function onMouseDown() {
	var shareBox = document.querySelector('#shareBox');
	if (shareBox !== null)

function onMouseUp() {
	var sel = document.getSelection(),
		txt = sel.toString();
	if (txt !== "") {
		var range = sel.getRangeAt(0);
		if (range.startContainer.parentElement.parentElement.localName === "article" || range.startContainer.parentElement.localName === "article") {
			document.body.insertBefore(document.importNode(temp.content, true), temp);
			var rect = range.getBoundingClientRect();
			var shareBox = document.querySelector('#shareBox'); = `calc(${}px - 38px)`; = `calc(${rect.left}px + calc(${rect.width}px / 2) - 30px)`;
			var shareBtn = shareBox.querySelector('button');
			shareBtn['shareTxt'] = txt;
			shareBtn.addEventListener('mousedown', onShareClick, true);

function onShareClick() {`${this.shareTxt}`);