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

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 Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

              
                <body>
  <div class='wiki'>
    <h1 id=title>Wikipedia Search</h1>
  </div>
  <form id='searchBar'>
    <input type='search' id='search'>
  </form>
  <!--Random link html-->
  <div id='rando'>
    <a href='https://en.wikipedia.org/wiki/special:Random' target='_blank'>click here for random article</div>
  </div>
  <div id='resultsHere' class='row'></div>
</body>

              
            
!

CSS

              
                body {
  height: 100%;
  width: 100%;
  margin: 0;
  background-color: #404040;
  font-family: 'Anonymous Pro';
  font-size: 2em;
  text-decoration: none;
}
.wiki {
  color: yellow;
  text-align: center;
  margin-top: 25%;
  font-size: 2em;
  width: 50%;
  margin-right: auto;
  margin-left: auto;
}
@media (max-width:350px) {
  .wiki_search {
    margin-top: 45%;
  }
}
/*Random link css*/
#rando {
  text-align: center;
  text-radius: 25px;
  padding-top: .5em;
}
a:link {
  color: white;
}
a:visited {
   color: white;
  text-decoration: none;
  font-weight: bold;
}
#rando a:hover {
  color: white;
  text-decoration: none;
  font-weight: bold;
}
a:active {
  text-decoration: none;
}
/*search*/
input {
	outline: none;
}
input[type=search] {
	-webkit-box-sizing: content-box;
  -moz-box-sizing: content-box;
	font-size: 100%;
	background: transparent url(https://static.tumblr.com/ftv85bp/MIXmud4tx/search-icon.png) no-repeat 9px center;
	border: none;
	padding: 5px 10px 5px 2px;
	width: 55px;
	-webkit-transition: all .5s;
	-moz-transition: all .5s;
	transition: all 0.5s;
}
#searchBar input[type=search] {
	width: 15px;
	padding-left: 10px;
	color: transparent;
	cursor: pointer;
  background-color: transparent;
  border-bottom: .1em solid black;
}
#searchBar input[type=search]:hover {
	background-color: transparent;
}
#searchBar input[type=search]:focus {
	width: 120px;
	padding-left: 32px;
	color: #000;
	background-color: transparent;
	cursor: auto;
  border-bottom: .1em solid black;
  color: white;
}
#searchBar {
  text-align: center;
}
.results {
  margin-top: 1em;
  margin-bottom: 1em;
  padding: .5em .5em .5em .5em;
  background-color: white;
  text-align: center;
  margin-left: 3em;
  margin-right: 3em;
  color: black;
  background-color: #afafaf;
  text-decoration: none;
}
a:hover {
  text-decoration: none;
}
              
            
!

JS

              
                $(document).ready(function(){
   
  function searchWiki() {
        var APIcall= "http://en.wikipedia.org/w/api.php?action=query&list=search&format=json&srprop=snippet&callback=?&srsearch=" + $("#search").val();
    $.ajax({
      url: APIcall,
      dataType: 'jsonp',
      type: 'GET',
      success: function(json){
        $('#resultsHere').empty();
        var listResults =json.query.search;
        var html='';
        for (var result in listResults) {
          html="<a target='_blank' href='https://en.wikipedia.org/wiki/" + listResults[result].title + "'><div class = 'results'><h4>" + listResults[result].title + "</h4><p>" + listResults[result].snippet + "</p></div></a>";
          $("#resultsHere").append(html);
        };
      }
    });
  }
  
   $("#search").keypress(function(event) {
     if (event.which == 13) {
       searchWiki();
       return false;
     }
   });
  
  $("#search").on("click", function() {
    $(this).val("");
  });
})
              
            
!
999px

Console