Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

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.

+ add another resource


Babel includes JSX processing.

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


Add Packages

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.


Auto Save

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='pageOption'>
  <a href='#' class='option' data-inf='photo'>
    <img src=''>
  <a href='#' class='option' data-inf='cinema'>
    <img src=''>

<p class='box box--warn'>Note that while this demo still works fine and is preserved as it was originally created for historical reasons, we now have better ways (such as <code>clip-path</code> or <code>mask</code>) to achieve the same effect.</p>


                body { background: gainsboro; }
.pageOption {
  overflow: hidden;
  position: relative;
  margin: 0 auto;
  width: 40em; height: 27em;
.option, .option img { width: 100%; height: 100%; }
.option {
  overflow: hidden;
  position: absolute;  
  /* arctan(27 / 40) = 34.01935deg 
   * need to skew by 90deg - 34.01935deg = 55.98065deg
  transform: skewX(-55.98deg);
.option:first-child {
  left: -.25em;
  transform-origin: 100% 0;
.option:last-child {
  right: -.25em;
  transform-origin: 0 100%;
.option img { opacity: .75; transition: .5s; }
.option img:hover { opacity: 1; }
.option img, .option:after {
  transform: skewX(55.98deg);
  transform-origin: inherit;
.option:after {
  position: absolute;
  margin: .5em 1.65em;
  color: white;
  font: 500 1.25em Courier;
  letter-spacing: .1em;
  text-transform: uppercase;
  content: attr(data-inf);
.option:first-child:after { top: 0; left: 0; }
.option:last-child:after { right: 0; bottom: 0; }

/* warn info box styling */
.box {
	position: fixed;
	inset: auto 1vw 1vh;
	margin: 0;
	border-left: 5px solid #fd8721;
	padding: .75em;
	box-shadow: 2px 2px 5px hsl(0, 0%, 50%);
	background: #c34915;
	color: #fff;
	font: clamp(.625em, 4vw, 1.25em)/ 1.25 trebuchet ms, ubuntu, 
		verdana, arial, sans-serif;

code {
	padding: 2px;
	background: hsla(0, 0%, 0%, .2);
	font: 1.1em/ 1.2 ubuntu mono, 
		consolas, monaco, monospace


                /* absolutely no JS πŸ™ƒ */