Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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 style="padding:6px; text-align:center;">
		<input type="button" onClick="iBold(rtContent);" value="B" />
		<input type="button" onClick="iItalic(rtContent);" value="I" />
		<input type="button" onClick="iUnderline(rtContent);" value="U" />
		<input type="button" onClick="iFontSize(rtContent);" value="Font Size" />
		<input type="button" onClick="iFontColor(rtContent);" value="Font Color" />
		<input type="button" onClick="iLink(rtContent);" value="Link" />
		<input type="button" onClick="iUnLink(rtContent);" value="Remove Link" />
		<input type="button" onClick="iOrderedList(rtContent);" value="Numbered List" />
    <br />
		<input type="button" onClick="iUnorderedList(rtContent);" value="Bulleted List" />
		<input type="button" onClick="iImg(rtContent);" value="Insert Image" />
		<input type="button" onClick="iYouTube();" value="Embed YouTube" />
		<input type="button" onClick="iVimeo();" value="Embed Vimeo" />
		<input type="button" onClick="iGoogleDoc();" value="Embed GoogleDoc" />
  <br /><br />
  <form method="POST" action="classes.php?mode=new" name="contentForm" id="contentForm">
      <textarea style="display:none;" cols="75" rows="4" name="content" id="content"></textarea>
      <iframe name="rtContent" id="rtContent" class="rtContentBox"></iframe>
  </form>
  
</div>
              
            
!

CSS

              
                /* edit page styling */
.rtContentBox {
	border: #999 1px solid;
	width: 100%;
	height: 200px;
}
input {
  padding: 6px;
  margin: 4px 8px 4px 0px;
}
              
            
!

JS

              
                iFrameOn();

function iFrameOn () {
	rtContent.document.designMode = 'On';
	if ( document.contains(document.getElementById("rtContent2")) ) {
	rtContent2.document.designMode = 'On';
	}
}
function iBold (targetFrame) {
	targetFrame.document.execCommand('bold',false,null);
}
function iItalic (targetFrame) {
	targetFrame.document.execCommand('italic',false,null);
}
function iUnderline (targetFrame) {
	targetFrame.document.execCommand('underline',false,null);
}
function iUploadImg (url) {
	var win = window.open(url, '_blank');
	win.focus();
}
function iImg (targetFrame) {
	var imgSrc = prompt('Enter the image\'s location URL. Use the "Upload Image" button to upload an image from your computer and then enter the URL it provides on the confirmation page.','http://');
	if ( imgSrc != null){
		targetFrame.document.execCommand('insertimage',false,imgSrc)	
	}
}
function iLink (targetFrame) {
	var linkURL = prompt('Enter the URL for this link:', 'http://');
	if ( linkURL != null){
		targetFrame.document.execCommand('CreateLink',false,linkURL);
	}
}
function iUnLink (targetFrame) {
	targetFrame.document.execCommand('UnLink',false,null);
}
function iYouTube () {
	var youTubeLink = prompt('Enter the YouTube video URL. Make sure nothing is appended to it. For help on how to do this, see the support page.', 'http://');
	var youTubeEmbed = '[youtube]' + youTubeLink + '[/youtube]';
	window.frames['rtContent'].document.body.innerHTML = window.frames['rtContent'].document.body.innerHTML + youTubeEmbed;
}
function iVimeo () {
	var vimeoLink = prompt('Enter the Vimeo video URL.', 'http://');
	var vimeoEmbed = '[vimeo]' + vimeoLink + '[/vimeo]';
	window.frames['rtContent'].document.body.innerHTML = window.frames['rtContent'].document.body.innerHTML + vimeoEmbed;
}
function iGoogleDoc () {
	var googleDocLink = prompt('Enter the Google Doc Link.', 'https://');
	var googleDocEmbed = '[googledoc]' + googleDocLink + '[/googledoc]';
	window.frames['rtContent'].document.body.innerHTML = window.frames['rtContent'].document.body.innerHTML + googleDocEmbed;
}
function iFontSize (targetFrame) {
	var fSize = prompt('Enter a size, 1 - 7.', '');
	targetFrame.document.execCommand('FontSize',false,fSize)
}
function iFontColor (targetFrame) {
	var fColor = prompt('Enter a basic color or use a hexadecimal color code.', '');
	targetFrame.document.execCommand('ForeColor',false,fColor)
}
function iUnorderedList (targetFrame) {
	targetFrame.document.execCommand('InsertUnorderedList',false,'newUL');
	targetFrame.focus();
}
function iOrderedList (targetFrame) {
	targetFrame.document.execCommand('InsertOrderedList',false,'newOL');
	targetFrame.focus();
}
function submitForm () {
	var theForm = document.getElementById("contentForm");
	theForm.elements["content"].value = window.frames['rtContent'].document.body.innerHTML;
	if ( document.contains(theForm.elements["preview"]) ) {
	theForm.elements["preview"].value = window.frames['rtContent2'].document.body.innerHTML;
	}
	theForm.submit();
}
              
            
!
999px

Console