cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation


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.

    <title>Wikipedia Viewer</title>
    <div class="box">
      <h4>Click here for a random article</h4>
      <div class="container-fluid">
        <span class="icon"><i class="fa fa-search fa-5x"></i></span>
        <input  id="search" type="text" placeholder="search...">
       <div class="articles">
              body {
  background: #343d46;
	color: #fff;
h4 {
  padding: 10%;
  text-align: center;

.box {
  margin: 0 auto;
  height: 50px;
  color: #fff;
.container-fluid {
  width: 300px;
  white-space: nowrap;
  position: relative;
.container-fluid input#search {
  height: 50px;
  background: #2b303b;
  border: none;
  font-size: 10pt;
  float: left;
  color: #262626;
  padding-left: 45px;
  -webkit-border-radius: 25px;
  -moz-border-radius: 25px;
  border-radius: 25px;
  color: #fff;
  border: 5px solid orange;
  -webkit-transition: width .55s ease;
-moz-transition: width .55s ease;
-ms-transition: width .55s ease;
-o-transition: width .55s ease;
transition: width .55s ease-in;
.container-fluid input#search::-webkit-input-placeholder {
   color: #65737e;
.container-fluid input#search:-moz-placeholder { /* Firefox 18- */
   color: #65737e;  
.container-fluid input#search::-moz-placeholder {  /* Firefox 19+ */
   color: #65737e;  
.container-fluid input#search:-ms-input-placeholder {  
   color: #65737e;  

.container-fluid .icon {
  position: absolute;
  margin-top: -5px;
  margin-left: -55px;
  z-index: 1
  color: #4f5b66;
.fa-search {
  color: orange;
.container-fluid input#search:focus, .container-fluid input#search:active {
.container-fluid:hover input#search {

.articles {
	padding-top: 30px;    
  margin: 30px 20px;
.title {
	font-size: 1.5em;

.extract {
	bacground: #000;
	color: #fff;
   articles = $('.articles');
	 input = $('input');
	 input.change(function () {
        toSearch = input.val();
		// ajaxArticleData();
        				// request type ( GET or POST )
								type: 'GET',
        				// the URL to which the request is sent
								url: 'https://en.wikipedia.org/w/api.php',
        				// data to be sent to the server
								data: { action:'opensearch', format:'json', search:toSearch, limit:10, namespace: 0 },
        				// The type of data that you're expecting back from the server
								dataType: 'jsonp',
       			  // Function to be called if the request succeeds
							success: function(data){
									for(var i = 0; i < data[1].length; i++){
										articles.append('<h3><a href='+data[3][i]+' target="blank">'+data[3][i]+'</a></h3><br/><br/>');


Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.


Loading ..................