<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>
</div>
<div id="container">
<div class="grid">
<div>Alfa</div>
<div>Beta</div>
<div>Charlie</div>
<div>Delta</div>
<div>Echo</div>
<div>Foxtrot</div>
</div>
</div>
* { 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;
}
.grid {
display: grid;
grid-gap: 10px;
grid-template-columns: 5em 5em 5em;
justify-content: start;
}
.grid :first-child {
grid-area: 1 / 2 / 3 / 4;
}
.fixed-width {
width: 200px;
}
.grid > * {
border: 5px solid rgb(108,91,123);
border-radius: 5px;
padding: 10px;
}
var writingMode = document.getElementById("writingMode");
writingMode.addEventListener("change", function (evt) {
document.getElementById("container").style.writingMode = evt.target.value;
});
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.