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

	<div class="buttons row">
		<div class="col-md-12" align="center">	
			<a href="#" class="button-search" onclick="getSearch();">
				<i class="fa fa-search fa-5x" aria-hidden="true"></i>

	<div class="search-box row">
		<div class="col-md-12" align="center">
			<input type="text" id="search-field" class="form-control" placeholder="Search Wikipedia for an article...">

	<div class="buttons row">
		<div class="col-md-12" align="center">
			<a href="" target="_blank">
				<i class="fa fa-random fa-5x" aria-hidden="true"></i>

<div class="container" id="results">



#search-field {
	width: 255px;
	font-size: 17px;
	text-align: center;

	color: #0f0f0f;
	text-decoration: none;

a:hover {
	font-size: 19px;

.search-box {
	margin-top: 50px;

.center {
	text-align: center;
	align: center;

.bottom {
	vertical-align: bottom;

.description {
	height: inherit;

body {
	background: #f0f0f0;

.img {
	max-height: inherit;
	vertical-align: center

h1 {
	color: #0f0f0f;

p {
	font-size: 17px;


	//Get input from search box;
	var searchValue;
	window.getSearch = function() {
		$("#results").html(""); //Clear any earlyer results if there were any;
		searchValue = document.getElementById("search-field").value;
		ajax(); //Run ajax request
	//Wikipedia API request url;
	var API = ''+

	//Function for getting data from wikipedia; 
	function ajax(){
		$.ajax( {
			url: API + searchValue,
			dataType: 'json',
			success: results,
			error: function (){
	//Function for displaying data;
	function results(data){
		//Check if there are results
		if(typeof data.query == "undefined") {
			$("#results").append('<h1 class="not-found animated slideInUp" align="center">Sorry, no results found for: '+ searchValue +'</h1>');
		} else {
			$("#results").append('<h1 class="animated slideInUp" align="center">Search results for: <b>'+ searchValue +'</b></h1>')
		//Get values of pages object to use in for loop
		var getPages = Object.getOwnPropertyNames(data.query.pages); 
		for ( i=0; i < getPages.length; i++ ){
			var page = data.query.pages[getPages[i]];
				'<div class="row well well-sm search-result animated slideInUp">'+
				'<div class="col-md-2 col-sm-12 col-xs-12 center">' +
					(typeof page.thumbnail != "undefined" ?  //Check if post has a thumbnail
					'<img src=' + page.thumbnail.source + ' class="img vertical-center">': '<img src="" class="img vertical-center">') +
				'<div class="col-md-10 col-sm-12 col-xs-12 description">'+
					'<h1 class="center">' + page.title + '</h1>' +
					'<p>' + page.extract + '</p>' +
					'<p class="center"><a href="' + page.fullurl + '" target="_blank" >Read more on Wikipedia <i class="fa fa-external-link" aria-hidden="true"></i></a></p>' +
		}; //End of for loop;
	}; //End of results(data);
}); //End of document.ready;