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.

              <!DOCTCYPE html>
<html lang="en">
	<meta charset="UTF-8">
	<title>Cat Facts</title>
	<link rel="stylesheet" href="css/normalize.css">
	<link rel="stylesheet" href="css/bootstrap.min.css">
	<link rel="stylesheet" href="css/main.css">
	<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">

<div class="container">
	<h1> Cat Facts </h1>
		<button class="btn btn-primary" id="fact-btn"> Learn Something About Cats </button>

		<div class="data text-center" id="fact-display">

	<div id="tweet-container"></div> 

 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
  <script src="js/app.js"></script>
              body {
		background-image: url("http://git.bbeckert.com/cat_facts/img/background.jpg");
		background-repeat: no-repeat;
		background-position: right center;
		background-size: cover;
		background-color: #727272;
		color: teal;
		font-family: arial; 

h1 {
	font-weight: bold;
.main {
		margin: auto;

#fact-btn {
		margin: 30px auto;
		height: 5em;
		background: teal;
		color: white;

.data {
		margin: 1em 0;
		font-weight: bold;
		font-size: 25px;
		font-style: italic;

#fact-display {
	width: 650px;

              $(document).ready(function() {
		var url = "http://crossorigin.me/http://catfacts-api.appspot.com/api/facts?number=1?callback=JSON_CALLBACK?"
		//twitter button js
		window.twttr = (function(d, s, id) {
				var js, fjs = d.getElementsByTagName(s)[0],
						t = window.twttr || {};
				if (d.getElementById(id)) return t;
				js = d.createElement(s);
				js.id = id;
				js.src = "https://platform.twitter.com/widgets.js";
				fjs.parentNode.insertBefore(js, fjs);

				t._e = [];
				t.ready = function(f) {

				return t;
		}(document, "script", "twitter-wjs"));

		//fact call back
		$("#fact-btn").click(function() {
				$.getJSON(url, function(data) {
						fact = data.facts[0];
				    text: fact,
				    hashtags: "cats, random, facts",
				    via: "CatFacts101",
				    count: "none"




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