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.


                <html lang="en">

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <script src=""></script>


<body ng-app="iCodefyApp" ng-cloak>
  <p> Long Place Holder </p> 
  <input type ="text" placeholder="Lorem ipsum dolor sit amet, consectetur adipiscing elit" placeholder-length />
  <p> short Place Holder </p> 
  <input type ="text" placeholder="Lorem ipsum dolor" placeholder-length />
  <p>Place Holder with default min-width 300px and buffer width 20px </p> 
  <input type ="text" placeholder="Lorem ipsum"  placeholder-length />
  <p>Place Holder with custom min-width 500px and buffer width 50px </p> 
  <input type ="text" placeholder="Lorem ipsum" placeholder-length minwidth="500" bufferwidth="50" />






                /* Directive used to dynamically change the width of the input box based on the place holder length
 * Example Usage
 * <input placeholder-length minwidth="250" bufferwidth="20" /> */

angular.module('iCodefyApp',[]).directive('placeholderLength', function($document) {
	return {
        restrict : 'A',
        scope :{
        	minwidth : "@",
        	bufferwidth : "@"
        link : function(scope,elem,attr){
        	if (angular.isUndefined(scope.minwidth) || scope.minwidth < 0 ){
        		scope.minwidth = 300;
        	if (angular.isUndefined(scope.bufferwidth) || scope.bufferwidth < 0 ){
        		scope.bufferwidth = 50;
            scope.minwidth = parseInt(scope.minwidth);
        	scope.bufferwidth= parseInt(scope.bufferwidth);
		    var fontSize = parseFloat(window.getComputedStyle(elem[0], null).getPropertyValue('font-size')); 
        	var mover = angular.element('<span style="visibility :hidden; position:absolute;left:-10000px;top:-10000px;font-size:'+fontSize+'px" class="calcWidth">'+attr.placeholder+'</span>');
        	var body = $document.find('body').eq(0);
        	scope.newidth = mover[0].offsetWidth + scope.bufferwidth;
        	scope.newidth = scope.newidth > scope.minwidth ? scope.newidth : scope.minwidth;
        	elem[0].setAttribute("style", "width:"+scope.newidth+"px");