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 esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM 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.
<main>
<div class="banner" aria-hidden="true">Hey there! We noticed that you’re not using a screen reader. Our website isn’t optimized for mouse users, please download <a href="https://www.nvaccess.org/download/" tabindex="-1">NVDA</a> on Windows or use VoiceOver on macOS. We don’t care about your personal needs, abilities and preferences. Thank you!
</div>
<h1 aria-label="Expressionist architecture">Document title</h1>
<p aria-hidden="true">
<strong>Expressionist architecture</strong> was an architectural movement in Europe during the first decades of the 20th century in parallel with the <a href="https://en.wikipedia.org/wiki/Expressionism" tabindex="-1">expressionist (Click your mouse to open this link)</a> visual and performing arts that especially developed and dominated in <a href="https://en.wikipedia.org/wiki/Germany" tabindex="-1" title="Germany">Germany (Click your mouse to open this link)</a>.
Expressionismus in einer der drei dominanten Stile der modernen Architektur: Internationaler Stil, Expressionismus und Konstruktivismus.
</p>
<p class="vh">
<strong>Expressionist architecture</strong> was an architectural movement in Europe during the first decades of the 20th century in parallel with the <a href="https://en.wikipedia.org/wiki/Expressionism">expressionist</a> visual and performing arts that especially developed and dominated in <a href="https://en.wikipedia.org/wiki/Germany" title="Germany">Germany</a>.
Expressionist architecture is one of the three dominant styles of Modern architecture International Style, Expressionist, and Constructivist architecture.
</p>
<figure>
<img src="https://assets.codepen.io/144736/hetschip_a11y.jpg" alt="Besides looking like a ship, Het Schip resembles a bizarre art form. Its appearance is unconventional from all angles. The exterior consists of bright orange bricks, decked with towers and architectural elements in unconventional shapes."/>
<figcaption>Dutch expressionism (Amsterdam School), Het Schip apartment building in Amsterdam, 1917–20 (Michel de Klerk)</figcaption>
</figure>
<p><a href="https://en.wikipedia.org/wiki/Het_Schip" class="btn" aria-label="Het Schip on wikipedia"></a></p>
<p aria-hidden="true">Brick Expressionism is a this movement special variant of The Netherlands and northern Germany in western and in.</p>
<p class="vh">Brick Expressionism is a special variant of this movement in western and northern Germany and in The Netherlands.</p>
<p class="hidden">
The term "Expressionist architecture" initially described the activity of the German, Dutch, Austrian, Czech and Danish avant garde from 1910 until 1930. Subsequent redefinitions extended the term backwards to 1905 and also widened it to encompass the rest of Europe. Today the meaning has broadened even further to refer to architecture of any date or location that exhibits some of the qualities of the original movement such as; distortion, fragmentation or the communication of violent or overstressed emotion.
</p>
<p>Important events in Expressionist architecture include the <a href="/wiki/Werkbund_Exhibition_(1914)" aria-label="Werkbund Exhibition (1914)">click here</a> in <a href="/wiki/Cologne" aria-label="Cologne">click here</a>, the completion and theatrical running of the <a href="/wiki/Gro%C3%9Fes_Schauspielhaus" lang="en" aria-label="Großes Schauspielhaus">click here</a>, Berlin in 1919, the <a href="/wiki/Glass_Chain" aria-label="Glass Chain">click here</a> letters, and the activities of the <a href="/wiki/Amsterdam_School" aria-label="Amsterdam School">click here</a>.</p>
<p class="vh">The style was characterised by an early-modernist adoption of novel materials, formal innovation, and very unusual massing.</p>
<ul aria-hidden="true">
<li>The style was
<ul>
<li>characterised by an
<ul>
<li>early-modernist adoption
<ul>
<li>of novel materials,
<ul>
<li>formal innovation,
<ul>
<li>and very unusual
<ul>
<li>massing
<ul>
<li>.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h2>Please rate your experience!</h2>
<form>
<fieldset>
<legend>
<span class="vh">Your Rating</span>
<span aria-hidden="true">✪ Legend ✪</span>
</legend>
<p>
<input type="radio" id="rating5" name="rating">
<label for="rating5" style="pointer-events: none">
<span class="vh">perfect</span>
<span aria-hidden="true">Circled white star Circled white star Circled white star Circled white star Circled white star</span>
</label>
</p>
<p>
<input type="radio" id="rating4" name="rating">
<label for="rating4" style="pointer-events: none">
<span class="vh">good</span>
<span aria-hidden="true">Circled white star Circled white star Circled white star Circled white star</span>
</label>
</p>
<p>
<input type="radio" id="rating3" name="rating">
<label for="rating3" style="pointer-events: none">
<span class="vh">ok</span>
<span aria-hidden="true">Circled white star Circled white star Circled white star</span>
</label>
</p>
<p>
<input type="radio" id="rating2" name="rating">
<label for="rating2" style="pointer-events: none">
<span class="vh">bad</span>
<span aria-hidden="true">Circled white star Circled white star</span>
</label>
</p>
<p>
<input type="radio" id="rating1" name="rating">
<label for="rating1" style="pointer-events: none">
<span class="vh">dreadful</span>
<span aria-hidden="true">Circled white star </span>
</label>
</p>
</fieldset>
<button type="submit" class="btn" onclick='alert("Thank you for your rating");' style="pointer-events: none">Send</button>
</form>
</main>
body {
max-width: 1000px;
margin: 0 auto;
font-family: sans-serif;
line-height: 1.7;
padding: 0 10px;
font-size: 1.2rem;
}
h1 {
line-height: 1.2;
}
h1, h2, p {
margin: 0;
}
img {
display: block;
}
main {
display: grid;
grid-template-columns: 1fr minmax(auto, 790px) 1fr;
padding: 3rem 0;
}
main > * {
grid-column: 2;
}
main > * + * {
margin: 2rem 0 0 0;
}
figure {
grid-column: 1 / -1;
}
figcaption {
font-size: 0.8em;
}
.hidden {
filter: invert(1);
}
.btn {
background: #305ca2;
color: #fff;
min-width: 14rem;
min-height: 2.6rem;
display: inline-block;
border-radius: 4px;
border: none;
font-size: 1.2rem;
}
.vh {
position: absolute;
white-space: nowrap;
width: 1px;
height: 1px;
overflow: hidden;
border: 0;
padding: 0;
clip: rect(0 0 0 0);
clip-path: inset(50%);
margin: -1px;
}
a:hover {
cursor: none;
}
fieldset {
margin-bottom: 1rem;
}
.banner {
background: salmon;
border: 5px solid red;
padding: 10px;
margin-top: 20px;
font-size: 1.2rem;
}
.banner a:link,
.banner a:visited {
color: #000000;
}
img {
max-width: 100%;
}
input {
position: absolute;
}
#rating4 {
top: 0;
left: 0;
}
#rating1 {
bottom: 5px;
right: 5px;
}
#rating2 {
bottom: 0;
left: 5px;
}
#rating3 {
top: 0;
right: 5px;
}
#rating5 {
position: relative;
}
fieldset {
position: relative;
}
Also see: Tab Triggers