Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

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.

+ add another resource


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <div class="controls">
<select id="writingMode">
  <option value="horizontal-tb">horizontal-tb</option>
  <option value="vertical-lr">vertical-lr</option>
  <option value="vertical-rl">vertical-rl</option>
  <select id="direction">
  <option value="ltr">ltr</option>
  <option value="rtl">rtl</option>

<div id="container">
<div class="box logical">
  My block-size is 150 pixels, my inline-size 250px.
<div class="box physical">
  My height is 150 pixels, my width 250px.



                * { box-sizing: border-box; }

html {
  font: 1.2em Helvetica, sans-serif;

body {
  padding: 40px;
  background-color: #fff;
  color: rgb(108,91,123);

.controls {
  background-color: rgba(0,0,0,.1);
  padding: 10px;
  border-radius: .5em;
  border: 1px solid rgba(0,0,0,.2);
  margin: 0 0 2em 0

.controls select {
  font-size: .9em;

#container {
  writing-mode: horizontal-tb;

.box {
  border: 5px solid rgb(108,91,123);
  border-radius: 5px;
  padding: 10px;
  margin: 10px;

.logical {
  block-size: 150px;
  inline-size: 250px;

.physical {
  height: 150px;
  width: 250px;


                var writingMode = document.getElementById("writingMode");
writingMode.addEventListener("change", function (evt) {
  document.getElementById("container").style.writingMode =;

var direction = document.getElementById("direction");
direction.addEventListener("change", function (evt) {