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.


                <div class="container main text-center">
  <div id="random">
    <p><a target='_blank' href="">Click for a Random Article</a></p>
  <div class='search-icon'><i class="fa fa-search fa-2x" aria-hidden="true"></i></div>
  <div class="search-input"><input type="text" name="search-q" value=""></input>
  <span class="close">X</span></div>
  <div id="instructions">Click the icon to search</div>

<div class="container">
  <div class="response"></div>


                body {
  background-color: #4a5e82; 
  font-size: 2.2em;
  color: #333;

#random a{
  text-decoration: none;
  color: #333;

.main {
  width: 500px;
  display: block;
  margin: 150px auto 50px auto;
.search-icon {
  display: inline;
  color: #FF8C00;
  padding: 10px;

.search-input {
  display: none;
  padding: 10px;
  border-style: solid;
  border-radius: 30px;
  border-width: 2px;
  border-color: #FF8C00;


input {
  display: inline;
  //border-radius: 15px;
  width: 380px;
  height: 30px;
  margin: 0px;
  padding: 5px 10px;
  background-color: #4a5e82;
  border-style: none;
  //border-color: #333;
  transition: width 2s;
   text-align: right;

.close {
   margin: 10px;

.article {
  background-color: #ddd;
  color: #333;
  margin: 10px auto;
  padding: 5px 10px;
  border-bottom: 2px #000 solid; 
  border-right: 2px #111 solid; 

.extract {
  font-size: .8em;


                $(document).ready(function() {

  $('.search-icon').click(function() {

  $('.search-input').click(function() {
    console.log('input box clicked');
    $('input').css('text-align', 'left');

  $('input').keypress(function(event) {

    var keycode = (event.keyCode ? event.keyCode : event.which);
    if (keycode == '13') {
      console.log('You pressed a "enter" key in textbox');

      var value = $(this).val();
      // $('.response').text(value);

   // event.stopPropagation();

  function searchWiki(str) {
    var url = "|extracts&pilimit=max&exintro&explaintext&exsentences=1&exlimit=max&gsrsearch=" + str;


    $.get(url, function(data) {

     var myKeys = Object.keys(data.query.pages)
        var title = data.query.pages[article].title;
        var extract = data.query.pages[article].extract;
        var url = '' + article;
        var html = '<div class="row article"><b><em class="title"><a href='+''+ article + '>'+ title + '</a></em></b><br>' +
            '<p class="extract">' + extract + '</p></div>';
    }, "jsonp" );