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.
<!-- HTML5 Kitchen sink by @dbox -->
<main>
<section>
<hgroup>
<h1>h1 HTML5 Kitchen Sink</h1>
<h2>h2 Back in my quaint <a href='#'>garden</a></h2>
<h3>h3 Jaunty <a href='#'>zinnias</a> vie with flaunting phlox</h3>
<h4>h4 Five or six big jet planes zoomed quickly by the new tower.</h4>
<h5>h5 Expect skilled signwriters to use many jazzy, quaint old alphabets effectively.</h5>
<h6>h6 Pack my box with five dozen liquor jugs.</h6>
</hgroup>
</section>
<hr>
<section>
<header>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</header>
<article>
<p>This paragraph is nested inside an article. It contains many different, sometimes useful, <a href="https://www.w3schools.com/tags/">HTML5 tags</a>. Of course there are classics like <em>emphasis</em>, <strong>strong</strong>, and <small>small</small> but there are many others as well. Hover the following text for abbreviation tag: <abbr title="abbreviation">abbr</abbr>. Similarly, you can use acronym tag like this: <acronym title="For The Win">ftw</acronym>. You can define <del>deleted text</del> which often gets replaced with <ins>inserted</ins> text.</p>
<p>You can also use <kbd>keyboard text</kbd>, which sometimes is styled similarly to the <code><code></code> or <samp>samp</samp> tags. Even more specifically, there is a tag just for <var>variables</var>. Not to be mistaken with blockquotes
below, the quote tag lets you denote something as <q>quoted text</q>. Lastly don't forget the sub (H<sub>2</sub>O) and sup (E = MC<sup>2</sup>) tags. </p>
</article>
<aside>This is an aside.</aside>
<footer>This is footer for this section</footer>
</section>
<hr>
<section>
<blockquote>
<p>Blockquote: I quickly explained that many big jobs involve few hazards</p>
</blockquote>
<blockquote>
<p>This is a mult-line blockquote with a cite reference. People think focus means saying yes to the thing you’ve got to focus on. But that’s not what it means at all. It means saying no to the hundred other good ideas that there are. You have to pick
carefully. I’m actually as proud of the things we haven’tdone as the things I have done. Innovation is saying no to 1,000 things.
<cite>Steve Jobs – Apple Worldwide Developers’ Conference, 1997</cite>
</p>
</blockquote>
</section>
<hr>
<section>
<table>
<caption>Tables can have captions now.</caption>
<tbody>
<tr>
<th>Person</th>
<th>Number</th>
<th>Third Column</th>
</tr>
<tr>
<td>Someone Lastname</td>
<td>900</td>
<td>Nullam quis risus eget urna mollis ornare vel eu leo.</td>
</tr>
<tr>
<td><a href="#">Person Name</a></td>
<td>1200</td>
<td>Vestibulum id ligula porta felis euismod semper. Donec ullamcorper nulla non metus auctor fringilla.</td>
</tr>
<tr>
<td>Another Person</td>
<td>1500</td>
<td>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Nullam id dolor id nibh ultricies vehicula ut id elit.</td>
</tr>
<tr>
<td>Last One</td>
<td>2800</td>
<td>Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet fermentum.</td>
</tr>
</tbody>
</table>
</section>
<hr>
<section>
<dl>
<dt>Definition List Title</dt>
<dd>Definition list division.</dd>
<dt>Kitchen Sink</dt>
<dd>Used in expressions to describe work in which all conceivable (and some inconceivable) sources have been mined. In this case, a bunch of markup.</dd>
<dt>aside</dt>
<dd>Defines content aside from the page content</dd>
<dt>blockquote</dt>
<dd>Defines a section that is quoted from another source</dd>
</dl>
</section>
<hr>
<section>
<ul>
<li>Unordered List item one
<ul>
<li>Nested list item
<ul>
<li>Level 3, item one</li>
<li>Level 3, item two</li>
<li>Level 3, item three</li>
<li>Level 3, item four</li>
</ul>
</li>
<li>List item two</li>
<li>List item three</li>
<li>List item four</li>
</ul>
</li>
<li>List item two</li>
<li>List item three</li>
<li>List item four</li>
</ul>
<hr>
<ol>
<li>List item one
<ol>
<li>List item one
<ol>
<li>List item one</li>
<li>List item two</li>
<li>List item three</li>
<li>List item four</li>
</ol>
</li>
<li>List item two</li>
<li>List item three</li>
<li>List item four</li>
</ol>
</li>
<li>List item two</li>
<li>List item three</li>
<li>List item four</li>
</ol>
</section>
<hr>
<section>
<address>1 Infinite Loop<br>
Cupertino, CA 95014<br>
United States</address>
</section>
<hr>
<section>
<pre>
pre {
display: block;
padding: 7px;
background-color: #F5F5F5;
border: 1px solid #E1E1E8;
border-radius: 3px;
white-space: pre-wrap;
word-break: break-all;
font-family: Menlo, Monaco;
line-height: 160%;
}</pre>
</section>
<hr />
<figure>
<img src="https://www.fillmurray.com/505/314">
<figcaption>Fig1. A picture of Bill Murray from <a href="https://www.fillmurray.com/">fillmurray.com</a></figcaption>
</figure>
<hr>
<section>
<form>
<p>
<label for="example-input-email">Email address</label>
<input type="email" id="example-input-email" placeholder="Enter email">
</p>
<p>
<label for="example-input-password1">Number</label>
<input type="number" id="example-input-number" placeholder="Number">
</p>
<p>
<label for="example-input-password">Password</label>
<input type="password" id="example-input-password" placeholder="Password">
</p>
<p>
<label for="example-input-search">Search</label>
<input type="search" id="example-input-serach" placeholder="Search ..">
</p>
<p>
<label for="example-input-tel">Telephone number</label>
<input type="tel" id="example-input-tel" placeholder="Telephone number">
</p>
<p>
<label for="example-input-text">Text</label>
<input type="text" id="example-input-text" placeholder="Enter some text here">
</p>
<p>
<label for="example-input-url">Url</label>
<input type="url" id="example-input-url" placeholder="Enter a url here">
</p>
<p>
<label for="example-input-color">Color</label>
<input type="color" id="example-inupt-color" placeholder="#fff">
</p>
<p>
<label for="example-input-date">Date</label>
<input type="date" id="example-input-date" placeholder="date">
</p>
<p>
<label for="example-input-date-time">Date / Time</label>
<input type="datetime" id="example-input-date-time" placeholder="date / time">
</p>
<p>
<label for="example-input-date-time-local">Date / Time local</label>
<input type="datetime-local" id="example-input-date-time-local" placeholder="date / time local">
</p>
<p>
<label for="example-input-month">Month</label>
<input type="month" id="example-input-month" placeholder="Month">
</p>
<p>
<label for="example-input-week">Week</label>
<input type="week" id="example-input-week" placeholder="Week">
</p>
<p>
<label for="example-input-time">Time</label>
<input type="time" id="example-input-time" placeholder="Time">
</p>
<p>
<label for="example-select1">Example select</label>
<select id="example-select1">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
</p>
<p>
<label for="example-select2">Example multiple select</label>
<select multiple id="example-select2">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
</p>
<p>
<label for="example-textarea">Example textarea</label>
<textarea id="example-textarea" rows="3"></textarea>
</p>
<p>
<label for="example-input-file">File input</label>
<input type="file" id="example-input-file">
</p>
<fieldset>
<legend>I am legend</legend>
<div>
<label>
<input type="radio" name="options-radios" id="optionsR-radios1" value="option1" checked> Option one is this and that—be sure to include why it's great
</label>
</div>
<div>
<label>
<input type="radio" name="options-radios" id="options-radios2" value="option2"> Option two can be something else and selecting it will deselect option one
</label>
</div>
<div>
<label>
<input type="radio" name="optionsRadios" id="options-radios3" value="option3" disabled> Option three is disabled
</label>
</div>
</fieldset>
<fieldset>
<legend>I am also legend</legend>
<input type="checkbox"> Check me out
<input type="checkbox"> Or check me out
</fieldset>
<p>
<button type="button" name="button">Button</button>
<input type="button" name="input" value="Input Button">
<input type="submit" name="submit" value="Submit Button">
<input type="reset" name="reset" value="Reset Button">
</p>
</form>
</section>
</main>
<!-- end kitchen sink -->
<!-- framework toggles -->
<div style="position: fixed; top: 0; right: 0; padding: 25px 25px; background: #eee;"><small>Toggle reset/framework:</small><br><br>
<div>
<label>
<input type="radio" name="options" id="browser-default" value="option1" href="#" onclick="swapStyleSheet('default.css')"> browser-default
</label></div>
<div>
<label>
<input type="radio" name="options" id="normalize" value="option2" href="#" onclick="swapStyleSheet('https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.css')"> meyer reset
</label></div>
<div>
<label>
<input type="radio" name="options" id="normalize" value="option3" href="#"
onclick="swapStyleSheet('https://cdnjs.cloudflare.com/ajax/libs/normalize/4.1.1/normalize.min.css')"> normalize
</label></div>
<div>
<label>
<input type="radio" name="options" id="sanitze" value="option4" href="#" onclick="swapStyleSheet('https://dl.dropboxusercontent.com/u/18590/sanitize.css')" checked> sanitize
</label></div>
<div>
<label>
<input type="radio" name="options" id="sanitze" value="option4" href="#" onclick="swapStyleSheet('https://dl.dropboxusercontent.com/u/18590/reeeset.css')" > reeeset
</label></div>
<div>
<label>
<input type="radio" name="options" id="bootstrap" value="option5" href="#"
onclick="swapStyleSheet('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css')"> bootstrap
</label></div>
<div>
<label>
<input type="radio" name="options" id="reboot" value="option6" href="#"
onclick="swapStyleSheet('https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta/css/bootstrap-reboot.css')"> reboot
</label></div>
<div>
<label>
<input type="radio" name="options" id="semantic-ui" value="option7" href="#" onclick="swapStyleSheet('https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.8/semantic.min.css')"> semantic-ui
</label>
</div>
<div>
<label>
<input type="radio" name="options" id="foundation" value="option8" href="#"onclick="swapStyleSheet('http:// cdn.foundation5.zurb.com/foundation.css')"> foundation
</label>
</div>
<div>
<label>
<input type="radio" name="options" id="mini-reset" value="option8" href="#"onclick="swapStyleSheet('https://cdn.bootcss.com/minireset.css/0.0.2/minireset.css')"> minireset
</label>
</div>
<div>
<label>
<input type="radio" name="options" id="modern-normalize" value="option8" href="#"onclick="swapStyleSheet('https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/modern-normalize.css')"> modern-normalize
</label>
</div>
<div>
<label>
<input type="radio" name="options" id="css-remedy" value="option8" href="#"onclick="swapStyleSheet('https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/remedy.css')"> CSS Remedy
</label>
</div>
</div>
// view/contritube on github:
// https://github.com/dbox/html5-kitchen-sink
//
// Things you can do with this:
// - See differences in Normalize/Reset/Santize/etc
// - Test various css frameworks
// - Quickly jumpstart your own boilerplate
body {
padding: 5%;
}
//https://cdn.bootcss.com/minireset.css/0.0.2/minireset.css
function swapStyleSheet(sheet){
document.getElementById('pagestyle').setAttribute('href', sheet);
}
Also see: Tab Triggers