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 is required to process package imports. If you need a different preprocessor remove all packages first.

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


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.


  <label>Caracteres restantes: <span></span></label>
  <input type="text" maxlength="150" />
  <label> Caracteres restantes: <span></span></label>
  <textarea maxlength="150"></textarea>


                body { font: 12px arial; }
label { display: block; }
input {
	box-sizing: border-box;
  margin: 5px 0 15px 0;
  padding: 5px;
	width: 100%;
textarea {
  box-sizing: border-box;
  font: 12px arial;
	height: 200px;
	margin: 5px 0 15px 0;
  padding: 5px 2px;
	width: 100%;  
.borderojo {
	outline: none;
	border: 1px solid #f00;
.bordegris { border: 1px solid #d4d4d; }


                var inputs = "input[maxlength], textarea[maxlength]";
	$(document).on('keyup', "[maxlength]", function (e) {
		var este = $(this),
			maxlength = este.attr('maxlength'),
			maxlengthint = parseInt(maxlength),
			textoActual = este.val(),
			currentCharacters = este.val().length;
			remainingCharacters = maxlengthint - currentCharacters,
			espan = este.prev('label').find('span');			
			// Detectamos si es IE9 y si hemos llegado al final, convertir el -1 en 0 - bug ie9 porq. no coge directamente el atributo 'maxlength' de HTML5
			if (document.addEventListener && !window.requestAnimationFrame) {
				if (remainingCharacters <= -1) {
					remainingCharacters = 0;            
			if (!!maxlength) {
				var texto = este.val();	
				if (texto.length >= maxlength) {
					este.val(text.substring(0, maxlength));
				else if (texto.length < maxlength) {