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. 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

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

              
                <span style="color:#db4437;font-size:32px;">Red Pill</span><br/>
<div style="position: relative;">
<input type="text" name="red" id="red" class="searchfield" placeholder="Search..." tabindex="2" value="This is a long search string to see the css text fader" />
<div id="fader"></div>
</div>

<br/><br/>

<span style="color:#4285f4;font-size:32px;">Blue Pill</span><br/>
<input type="text" name="blue" id="blue" class="searchfield" placeholder="Search..." tabindex="1" value="This is a long search string to see the css ellipsis" />
        
<br/><br/><br/>

<span style="color:#999;font-size:32px;">Neither</span><br/>
<input type="text" name="none" id="none" class="searchfield" placeholder="Search..." tabindex="1" value="This is a long search string that runs right off the edge" />
              
            
!

CSS

              
                * {
  font-family: sans-serif;
}

body { 
  background: #fff;
  padding: 30px;
}

#red {
  
}

#blue {
  text-overflow: ellipsis;
}

#none {
  padding-right: 0;
}

input {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  -ms-box-sizing: border-box;
  box-sizing: border-box;
}

.searchfield  {
  background: #fff;
  color: #000;
  width: 135px;
  padding: 6px;
  border: 1px solid #ccc;
}

#fader {
  position: absolute;
  width: 15px;
  height: 20px;
  top: 5px;
  left: 115px;

  cursor: text;

  background: -moz-linear-gradient(left,  rgba(255,255,255,0.5) 0%,  rgba(255,255,255,1) 100%); /* FF3.6+ */
  background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(255,255,255,0.5)), color-stop(100%,rgba(255,255,255,1))); /* Chrome,Safari4+ */
  background: -webkit-linear-gradient(left,  rgba(255,255,255,0.5) 0%,rgba(255,255,255,1) 100%); /* Chrome10+,Safari5.1+ */
  background: -o-linear-gradient(left,  rgba(255,255,255,0.5) 0%,rgba(255,255,255,1) 100%); /* Opera 11.10+ */
  background: -ms-linear-gradient(left,  rgba(255,255,255,0.5) 0%,rgba(255,255,255,1) 100%); /* IE10+ */
  background: linear-gradient(to right,  rgba(255,255,255,0.5) 0%,rgba(255,255,255,1) 100%); /* W3C */
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#80ffffff', endColorstr='#ffffff',GradientType=1 ); /* IE6-9 */

}
#fader { display:inline; }
#red:focus ~ #fader { display: none; }
              
            
!

JS

              
                /*** comment or share and tweet your answer to @DaveAlger ***/
              
            
!
999px

Console