HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs 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 its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
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.
Using packages here is powered by Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.3/themes/smoothness/jquery-ui.css">
<!--check-->
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<!--changed from lucoaong's version 1.11.3-->
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>Random Quote Generator</h1>
</div>
</div>
<div class="col-md-12 pad">
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-12">
<button type="button" class="btn btn-primary btn-block" onclick="genQuote()">
<h1>Generate a quote!</h1></button>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="pad"></div>
<div class="col-md-12">
<div id="display"></div>
</div>
</div>
</div>
<div class="container">
<div id="bottom" class="sidebar bottom">
<table class="table"><tr><td>
<!--start-->
<!--<ul class="share-buttons">
<li><a href="https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fcodepen.io%2Ftanyagupta%2Ffull%2FNGeZOm%2F&t=Random%20Quote%20Generator" title="Share on Facebook" target="_blank"><img src="https://googledrive.com/host/0B04eZCQrKlFtUG45bmJJdzMtOE0"></a></li>
<li><a href="https://twitter.com/intent/tweet?source=http%3A%2F%2Fcodepen.io%2Ftanyagupta%2Ffull%2FNGeZOm%2F&text=Random%20Quote%20Generator:%20http%3A%2F%2Fcodepen.io%2Ftanyagupta%2Ffull%2FNGeZOm%2F&via=tanyagupta" target="_blank" title="Tweet"><img src="https://googledrive.com/host/0B04eZCQrKlFtTUY4UWtfVHhMU2s"></a></li>
<li><a href="https://plus.google.com/share?url=http%3A%2F%2Fcodepen.io%2Ftanyagupta%2Ffull%2FNGeZOm%2F" target="_blank" title="Share on Google+"><img src="https://googledrive.com/host/0B04eZCQrKlFtekprZk9wUkFQaUk"></a></li>
<li><a href="https://www.linkedin.com/shareArticle?mini=true&url=http%3A%2F%2Fcodepen.io%2Ftanyagupta%2Ffull%2FNGeZOm%2F&title=Random%20Quote%20Generator&summary=Quote%20for%20the%20day&source=http%3A%2F%2Fcodepen.io%2Ftanyagupta%2Ffull%2FNGeZOm%2F" target="_blank" title="Share on LinkedIn"><img src="https://googledrive.com/host/0B04eZCQrKlFtTDBSZHpoaGg3RHM"></a></li>
<li><a href="mailto:?subject=Random%20Qute%20Generator&body=Quote%20for%20the%20day:%20http%3A%2F%2Fcodepen.io%2Ftanyagupta%2Ffull%2FNGeZOm%2F" target="_blank" title="Email"><img src="https://googledrive.com/host/0B04eZCQrKlFtQlhpZHpEcldYcnM"></a></li>
</ul>
-->
<!---end here-->
<p><font size="-1">
<span>Provided by: <a href="http://learnin60seconds.com">Learnin60seconds.com</a>
</span></font>
</p>
</td></tr>
</table>
</div>
</div>
.pad {
width: 300px;
height: 100px;
}
ul.share-buttons{
list-style: none;
padding: 0;
}
ul.share-buttons li{
display: inline;
}
#sbutton {
text-align: center;
}
function genQuote() {
var quotes = ["Wheat. So what?", "A penny for your thoughts?","A dollar for your death.","Get a life!", "...And since the stench of death will always attract flies and vermin, the arrival of Geraldo was perhaps inevitable","I'm sorry, but you must have me confused with some OTHER plate-lipped white girl named 'Irene'","You're just the sort of person I imagined marrying, when I was little except, yknow, not green and without all the patches of fungus.", "Every now and then when your life gets complicated and the weasels start closing in the only real cure is to load up on heinous chemicals and then drive like a bastard from Hollywood to Las Vegas.","Oh Mr. Bellpit, your legs are so swollen!","It's Czechoslovakia! It's like going into Wisconsin!","The heart, the liver, the spleen, the pancreas. All these miraculous organs work in total darkness","Nice tie... BONEHEAD!","Bicycle Repair Man, how can I ever repair you? Well, you don't need to, gov, it's all right. It's all in a day's work for ... Bicycle Repair Man. <Sniff!>","Comedy. Sudden, violent, comedy!","Bring the little ones unto me, and I will get a good price for them.","What do you say we guys go down to the beach and shoot some clams?","Zere were zwei peanuts walking down ze strasse. And one was assaulted.. peanut. Ha ha ha..","Ant Boy calmly prepares to execute his new friend ant-style...by PINCHING OFF HIS HEAD!","You think you got it rough? What about your darling doggy? Ten short years and he's getting old and groggy.","I'm not saying we won't get our hair mussed a bit..","Thank God. The police.","I don't know what you want here, but I think you should know that I've killed a LOT of old people in my time, and I'm not above doing it again.","I told them kids to keep their arms inside the ride. Damnedest thing I ever saw.","But Calvin is no kind and loving god! He's one of the _old_ gods! He demands sacrifice!", "Cerebus can destroy ANYTHING. Cerebus is the POPE.","I'll have you all executed! I think not.","Psychophallystisis. Eat hot death, Steve.","I'm a LAGOMORPH, Sam! Look it up!"];
var selected=getRandomIntInclusive(1,quotes.length);
document.getElementById("display").innerHTML="<h3>"+quotes[selected]+"</h3>";
}
function getRandomIntInclusive(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
Also see: Tab Triggers