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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

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

Packages

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.

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

              
                <html>
<head>
	<title>Chuck Norris Quotes</title>
</head>
<body>
	<div class="container"><!-- Content here -->
		<div class="jumbotron">
			<h1 class="display-3 text-center">Chuck Norris Quotes</h1>
			<p class="lead text-center">This is a simple random Chuck Norris quotes generator to keep you happy!</p>
			<div class="text-xs-center"><img class="theManHimself rounded" src="https://media.giphy.com/media/3hvmlYNsOTFWE/giphy.gif"></div>
			<hr>
			<blockquote class="blockquote blockquote-reverse">
				<p class="mb-0 message">This is where the will be</p>
			</blockquote><br>
			<a class="btn btn-primary btn-lg" id="twitterSend" target="_blank"><i class="fa fa-twitter"></i> Tweet This Quote</a> <button class="btn btn-primary btn-lg outline-primary" id="theMessage">Get Another Quote</button>
		</div>
	</div><!-- end container -->
</body>
</html>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Merriweather');
*{
  font-family: 'Merriweather', serif;
}
.text-left {
	text-align: left;
}
.text-right {
	text-align: right;
}
.text-center {
	text-align: center;
}
strong {
	font-weight: 700;
}
.jumbotron {
	background-color: #4D438E;
}
h1, p {
	color: #F3E6D3;
}
hr {
	border-color: #F0772D;
  border-width: 2px;
  margin: 30px 0 40px 0;
}
.blockquote, .mb-0, .message {
	color: #FFF;
	font-size: 28px;
}
.blockquote-reverse {
	border-color: #F0772D;
}
#theMessage {
	float: right;
}
.theManHimself{
  margin: 30px 0;
}
              
            
!

JS

              
                $(document).ready(function() {
	$.getJSON("https://api.icndb.com/jokes/random", function(json) {
		$(".message").html((json.value.joke));
		updateTweet(json)
	});
});
$("#theMessage").on("click", function() {
	$.getJSON("https://api.icndb.com/jokes/random", function(json) {
		$(".message").html((json.value.joke));
		updateTweet(json);
	});
});

function updateTweet(json) {
	var theQuote = json.value.joke;
	$("#twitterSend").attr("href", "https://twitter.com/intent/tweet?text=" + theQuote + "@benjaminthedev I love your quote generator!");
}






              
            
!
999px

Console