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 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.
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.
<div id="monkbar">
<div id="sitename">
<h1><a href="https://www.perlmonks.org/?">Perl::Monks</a></h1>
<p>Perl is fun! (quip)</p>
</div>
<div id="pair">
<a href="https://www.pair.com/">
<img src = "https://promote.pair.com/i/pair-banner-current.gif"
height = "60"
width = "468"
alt = "Beefy Boxes and Bandwidth Generously Provided by pair Networks" />
</a>
</div>
<div id="search">
<form method="get" action="?"
enctype="application/x-www-form-urlencoded" >
<input type="text" name="node"
id="search_text"
size="20" maxlength="300" />
<input class="titlebar" type="submit"
value="Search" />
</form>
<a href="https://www.perlmonks.org/?node=Super%20Search" id="SuperSearch">Super Search</a>
</div>
</div>
<div class="nodelets">
<details class="top_details" id="navigavtion">
<summary class="top_summary">Navigation</summary>
<ul>
<li>
<a href="https://www.perlmonks.org/?">The Monastery Gates</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node=Seekers%20of%20Perl%20Wisdom">Seekers of Perl Wisdom</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node=Meditations">Meditations</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node=Cool%20Uses%20for%20Perl">Cool Uses For Perl</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node=Obfuscated%20Code">Obfuscation</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node=Perl%20Poetry">Poetry</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node=Perl%20Monks%20Discussion">PerlMonks Discussion</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node=Perl%20News">Perl News</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node=Categorized%20Questions%20and%20Answers">Q&A</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node=Tutorials">Tutorials</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node=Reviews">Reviews</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node=Offering%20Plate">Donate</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node=Tidings">What's New</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node=Newest%20Nodes">Newest Nodes</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node=Recently%20Active%20Threads">Recent Threads</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node=PerlMonks%20FAQ">Help</a>
</li>
</ul>
</details>
<details class="top_details" id="user">
<summary class="top_summary">User</summary>
<details>
<summary class="sub_summary">Log In</summary>
Log in
</details>
<p>or</p>
<details>
<summary class="sub_summary">Settings</summary>
<ul>
<li>
<a href="https://www.perlmonks.org/?node_id=109;op=logout">Log out</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node_id=161890;displaytype=edit">My info</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node_id=1072">User</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node_id=450961">Display</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node_id=25185">Nodelet</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node_id=192270">Timezone</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node_id=14444">Signature</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node_id=492848">Newest Nodes</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node_id=492690">RAT Style</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node_id=492700">Free Nodelet</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node_id=366609">Personal Nodelet</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node_id=512013">Message</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node_id=17003">Pmdev</a>
</li>
<li>
<a href="https://www.perlmonks.org/?node_id=16082">Ignored users</a>
</li>
</ul>
</details>
</details>
<details class="top_details" id="more_nodelets">
<summary class="top_summary">Nodelets</summary>
<details>
<summary class="sub_summary">
XP nodelet<sup><a href="https://www.perlmonks.org/?node_id=590110" title="XP Nodelet FAQ">?</a></sup>
</summary>
Nodelet data
</details>
<details>
<summary class="sub_summary">
Approval nodelet<sup><a href="https://www.perlmonks.org/?node_id=590076" title="Approval Nodelet FAQ">?</a></sup>
</summary>
Nodelet data
</details>
<details>
<summary class="sub_summary">
Tick tock<sup><a href="https://www.perlmonks.org/?node_id=590107" title="Tick tock Nodelet FAQ">?</a></sup>
</summary>
Nodelet data
</details>
<details>
<summary class="sub_summary">
Personal nodelet<sup><a href="https://www.perlmonks.org/?node_id=590101" title="Personal Nodelet FAQ">?</a></sup>
</summary>
Nodelet data
</details>
<details>
<summary class="sub_summary">
Chatterbox<sup><a href="https://www.perlmonks.org/?node_id=590082" title="Chatterbox Nodelet FAQ">?</a></sup>
</summary>
Nodelet data
</details>
<details>
<summary class="sub_summary">
Other Users<sup><a href="https://www.perlmonks.org/?node_id=590099" title="Other Users Nodelet FAQ">?</a></sup>
</summary>
Nodelet data
</details>
<details>
<summary class="sub_summary">
Keyword nodelet<sup><a href="https://www.perlmonks.org/?node_id=590092" title="Keyword Nodelet FAQ">?</a></sup>
</summary>
Nodelet data
</details>
<details>
<summary class="sub_summary">
Find Nodes<sup><a href="https://www.perlmonks.org/?node_id=590087" title="Find Nodes Nodelet FAQ">?</a></sup>
</summary>
Nodelet data
</details>
<details>
<summary class="sub_summary">
Voting Booth<sup><a href="https://www.perlmonks.org/?node_id=590108" title="Voting Booth Nodelet FAQ">?</a></sup>
</summary>
Nodelet data
</details>
<details>
<summary class="sub_summary">
Function nodelet<sup><a href="https://www.perlmonks.org/?node_id=590090" title="Function Nodelet FAQ">?</a></sup>
</summary>
Nodelet data
</details>
<details>
<summary class="sub_summary">
Node navigator<sup><a href="https://www.perlmonks.org/?node_id=590097" title="Node Navigator Nodelet FAQ">?</a></sup>
</summary>
Nodelet data
</details>
<details>
<summary class="sub_summary">
Free nodelet<sup><a href="https://www.perlmonks.org/?node_id=786930" title="Free Nodelet FAQ">?</a></sup>
</summary>
Nodelet data
</details>
<details>
<summary class="sub_summary">
Domain nodelet<sup><a href="https://www.perlmonks.org/?node_id=590084" title="Domain Nodelet FAQ">?</a></sup>
</summary>
<a href="https://www.perlmonks.com">www</a>.<a href="https://perlmonks.com">com</a> |
<a href="https://www.perlmonks.net">www</a>.<a href="https://perlmonks.net">net</a> |
<a href="https://www.perlmonks.org">www</a>.<a href="https://perlmonks.org">org</a>
</details>
<details>
<summary class="sub_summary">
Sections<sup><a href="https://www.perlmonks.org/?node_id=590104" title="Sections Nodelet FAQ">?</a></sup>
</summary>
Nodelet data
</details>
<details>
<summary class="sub_summary">
Information<sup><a href="https://www.perlmonks.org/?node_id=590091" title="Information Nodelet FAQ">?</a></sup>
</summary>
Nodelet data
</details>
<details>
<summary class="sub_summary">
Leftovers<sup><a href="https://www.perlmonks.org/?node_id=590093" title="Leftovers Nodelet FAQ">?</a></sup>
</summary>
Nodelet data
</details>
<details>
<summary class="sub_summary">
CPAN<sup><a href="https://www.perlmonks.org/?node_id=590078" title="CPAN Nodelet FAQ">?</a></sup>
</summary>
Nodelet data
</details>
<details>
<summary class="sub_summary">
Node Status<sup><a href="https://www.perlmonks.org/?node_id=590096" title="Node Status Nodelet FAQ">?</a></sup>
</summary>
Nodelet data
</details>
<details>
<summary class="sub_summary">
Nodelet nodelet<sup><a href="https://www.perlmonks.org/?node_id=590098" title="Notelet Nodelet FAQ">?</a></sup>
</summary>
Nodelet data
</details>
<details>
<summary class="sub_summary">
Daily Best<sup><a href="https://www.perlmonks.org/?node_id=590083" title="Daily Best Nodelet FAQ">?</a></sup>
</summary>
Nodelet data
</details>
<details>
<summary class="sub_summary">
Weekly Best<sup><a href="https://www.perlmonks.org/?node_id=590109" title="Weekly Best Nodelet FAQ">?</a></sup>
</summary>
Nodelet data
</details>
<details>
<summary class="sub_summary">
Monthly Best<sup><a href="https://www.perlmonks.org/?node_id=590095" title="Monthly Best Nodelet FAQ">?</a></sup>
</summary>
Nodelet data
</details>
<details>
<summary class="sub_summary">
Notices
</summary>
Nodelet data
</details>
</details>
</div>
<h2>Username</h2>
<h2>This is a very long thread title that would normally be wrapped twice by now.</h2>
<p>It might be best if the nagivation, user, and nodelets dropdowns were closed on mobile.</p>
<p>I moved the user and user logout to the right.</p>
<p>The nodelets would need three options.</p>
<ul>
<li>Show the nodelet</li>
<li>Placement of the nodelet</li>
<li>Whether the nodelet is open or closed.</li>
</ul>
<p>The layout changes when on a smaller screen. If you are using Firefox, hit <code>ctrl-alt-m</code> to see it.</p>
<p>Cyan seems to be the color of choice for Perl.</p>
* {
font-family: "sans-serif";
}
a {
text-decoration: none;
}
code {
font-family: monospace;
background-color: #eee;
}
div#monkbar {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
align-content: stretch;
align-items: center;
margin: 0 0 1px 0;
padding: 10px .5em;
background-color: #069;
color: #fff;
}
#monkbar h1 {
margin: 0;
font-size: 250%;
}
#monkbar a {
color: #fff;
}
#monkbar p {
margin: 0;
}
#monkbar img {
max-width: 100%;
}
#search {
display: block;
text-align: right;
}
input[type=submit] {
background-color: #09c;
color: #fff;
font-size: 105%;
}
div.nodelets {
float: right;
font-size: 90%;
}
details {
border: 2px solid #069;
background-color: #cef;
}
details details {
border-left: none;
border-right: none;
}
summary.top_summary {
background-color: #069;
border: 2px solid #069;
color: #fff;
}
summary.sub_summary {
background-color: #08b;
color: #fff;
}
summary a {
color: #fff;
}
div.nodelets ul {
margin: 0;
padding: 2px;
}
div.nodelets li {
list-style-type: none;
}
@media screen and (max-width: 700px) {
div#monkbar {
flex-direction: column;
padding: 0;
text-align: center;
}
div#sitename {
order: 2;
}
div#pair {
order: 1;
}
div#search {
order: 3;
text-align: center;
}
div.nodelets {
float: none;
font-size: 100%;
}
}
function setDetailsOpen() {
document.querySelectorAll('details.top_details').forEach(el => el.open = window.innerWidth > 700);
}
window.addEventListener('resize', setDetailsOpen);
setDetailsOpen();
Also see: Tab Triggers