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

              
                <input placeholder="Search..."></input>
<blockquote>Lastly, she pictured to herself how this same little sister of hers would, in the after-time, be herself a grown woman; and how she would keep, through all her riper years, the simple and loving heart of her childhood; and how she would gather about her other little children, and make their eyes bright and eager with many a strange tale, perhaps even with the dream of Wonderland of long ago; and how she would feel with all their simple sorrows, and find a pleasure in all their simple joys, remembering her own child-life, and the happy summer days.</blockquote>
<cite>Lewis Carroll&mdash;Alice's Adventures in Wonderland</cite>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Lato:300);
$highlight: #ff5500;
$background: #222;
$text: #fff8d6;

body {
  background: linear-gradient(to bottom, $background 0%,lighten($background,5%) 50%,$background 100%);
  padding:0;
  margin:0;
  height:100vh;
  width:100vw;
  color:$text;
  font-family: 'Lato', sans-serif;
  line-height:200%;
  font-size:24px;
  display:flex;
  align-items:center;
  justify-content: center;
  flex-direction:column;
}

blockquote {
  width:50%;
  max-width:1000px;
}

input {
  background:$highlight;
  border: solid 1px mix($highlight, $text, 50%);
  padding:10px;
  font-family: 'Lato', sans-serif; 
  color: $text;
  font-size:32px;
  width:40%;
  max-width:800px;
  &:focus {
    outline: solid 1px $text;
  }
  &::-webkit-input-placeholder {
     color: mix($highlight, $text, 60%);
  }

  &:-moz-placeholder { /* Firefox 18- */
     color: mix($highlight, $text, 60%);  
  }

  &::-moz-placeholder {  /* Firefox 19+ */
     color: mix($highlight, $text, 60%);  
  }

  &:-ms-input-placeholder {  
     color: mix($highlight, $text, 60%);  
  }
}

span {
  background: linear-gradient(to bottom, transparentize($highlight, 1) 0%,transparentize($highlight, 1) 45%, $highlight 45%, $highlight 75%,transparentize($highlight, 1) 75%,transparentize($highlight, 1) 100%);
}
              
            
!

JS

              
                var src_str = $("blockquote").text();
var term;

$("input").keyup(function() {
  $("blockquote").text(src_str);
  term = $("input").val();
  var highlight = $("blockquote").text()
  $("blockquote").html(function(_, html) {
   return html.split(term).join("<span class='smallcaps'>" + term + "</span>");
  });
})
              
            
!
999px

Console