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.
<h2>Vertical Form Controls</h2>
<div class="wrapper">
<section>
<h4><textarea></h4>
<textarea rows="15">
何は前せっかくその推察家という方の所にするですない。はたして事実が観念帰りはむくむくその通知たでまでで至るばいるたをは尊重なりないでて、そうにはできるでですですでし。学校へさたのはまあほかがよくですますた。せっかく槙さんを刺戟教師さっそく自失が行っなけれ腹の中同じ尻馬これかお話しのとしてお助力なたたまして、その結果はこれか模範教師にしから、大森君の訳に国家の私をせっかくご作文として彼ら偽りからお妨害が進んようにのらくらご使用がありましなけれと、何しろすでに立脚にもっですているありのが知れますあり。すなわちすなわちご国家のいうのはもともと好きと解らませと、その気がは連れうがという学校をありてくるですまし。
その時先方の以上いわゆる事はそれ中の与えたかとネルソンさんをよっべきます、辺の前ですというおお尋ねだだないて、探照灯の上を衣食の前までの国家から前さて切らば、始終の一遍にましてその以上をけっしてさますませとかけるたものなば、忌まわしいですなので実際ご事なっます事ですですで。もしくは英文かあやふやか影響にいうですて、絶対中義務にしばいた時にご招待の先刻に思わなけれでし。前にはかくすると立ったたんたて、はなはだしかるにして#「もずいぶんないますものます。またお払底に引張りのでもおいたのなくて、当座のも、けっして私か次ぐて訊かれるんませ致すられないたと加えるて、文芸は与えといるですまし。すでに無論はあたかも自分といういませし、そこへは次第ごろとも私のご説明はもったいない怒っ下さろありでしょ。
</textarea>
</section>
<section>
<h4><input type=text></h4>
<input type=text value="日本">
</section>
<section>
<h4><input type=checkbox switch></h4>
<input type="checkbox" switch checked>
</section>
<section>
<h4><meter></h4>
<meter min="0" max="100" low="33" high="66" optimum="80" value="30"></meter>
<meter min="0" max="100" low="33" high="66" optimum="80" value="50"></meter>
<meter min="0" max="100" low="33" high="66" optimum="80" value="90"></meter>
</section>
<section>
<h4><input type=range></h4>
<input type="range" value="20" max="100">
</section>
<section>
<h4><progress></h4>
<progress value="40" min="0" max="100"></progress>
<progress value="80" min="0" max="100"></progress>
</section>
<section>
<h4><input type=checkbox></h4>
<div style="writing-mode: vertical-rl">
<div>
<input type="checkbox" id="checkbox1" checked />
<label for="checkbox1">ブルーベリー</label>
</div>
<div>
<input type="checkbox" id="checkbox2" />
<label for="checkbox2">さくらんぼ</label>
</div>
<div>
<input type="checkbox" id="checkbox3" />
<label for="checkbox3">ココナッツ</label>
</div>
</div>
</section>
<section>
<h4><input type=radio></h4>
<div style="writing-mode: vertical-rl">
<div>
<input type="radio" id="radio1" checked />
<label for="radio1">ブルーベリー</label>
</div>
<div>
<input type="radio" id="radio2" />
<label for="radio2">さくらんぼ</label>
</div>
<div>
<input type="radio" id="radio3" />
<label for="radio3">ココナッツ</label>
</div>
</div>
</section>
<section>
<h4><input type=search></h4>
<input type=search value="日本" results="3">
</section>
<section>
<h4><input type=number></h4>
<input type=number>
</section>
<section>
<h4><input type=button></h4>
<input type="button" value="こんにちは">
</section>
<section>
<h4><input type=file></h4>
<input type=file>
</section>
<section>
<h4><select></h4>
<select>
<option>選択</option>
<option>あいなき</option>
<option>あらまほしき</option>
<option>わろき</option>
</select>
</section>
<section>
<h4><select multiple></h4>
<select multiple="" size="7">
<option>りんご</option>
<option>あんず</option>
<option>バナナ</option>
<option>ブルーベリー</option>
<option>さくらんぼ</option>
<option>ココナッツ</option>
<option>ぶどう</option>
<option>キウイ</option>
<option>レモン</option>
<option>びわ</option>
<option>マンゴー</option>
<option>メロン</option>
<option>オレンジ</option>
<option>もも</option>
<option>なし</option>
<option>かき</option>
<option>パイナップル</option>
<option>きいちご</option>
<option>いちごy</option>
<option>すいかn</option>
</select>
</section>
<!-- <section>
<h4><input type=color></h4>
<input type=color value="#FF0000">
</section> -->
</div>
input, meter, progress, select, fieldset, textarea {
writing-mode: vertical-rl;
}
body {
background: #f5f5dc;
margin: 2rem calc(2rem + 1vw);
font-size: 90%;
}
@media (prefers-color-scheme: dark) {
body {
background: #4a4a0b;
}
}
.wrapper {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(12ic, 1fr));
gap: 2ic;
}
h2, h4 {
font-family: system-ui;
}
textarea {
margin-block-start: 2ic;
}
Also see: Tab Triggers