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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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.


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="container">
  <div class="menu">
    <div data-type="float" class="active">FLOAT</div>
    <div data-type="ellipse">ELLIPSE</div>
    <div data-type="circle">CIRCLE</div>
    <div data-type="polygon">POLYGON</div>
    <div data-type="url">URL</div>
    <img src="" class="lemon-float">
    <h2><span class="type">FLOAT</span> Lorem, ipsum.</h2>
    Lorem ipsum dolor sit amet consectetur, adipisicing elit. Enim laborum eveniet consectetur harum accusamus!
    Dignissimos atque magni numquam quam cupiditate consequuntur aspernatur quia, itaque repellendus possimus
    quibusdam earum enim, asperiores voluptates. Nisi nesciunt sint quas iusto qui, vero beatae aspernatur at
    exercitationem eos blanditiis velit impedit ex...
  <small>Unfortunately, there is CORS in the URL version and you need to handle it, and since I don't have a pro version in codepen, I won't add the file locally and the url example doesn't work.</small>


                :root {
  --color-hover: 250, 128, 114;

:before {
  box-sizing: border-box;

html {
  height: 100%;

html {
  margin: 0;
  padding: 0;

body {
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial,
    sans-serif, Apple Color Emoji, Segoe UI Emoji;
  font-size: 1.4rem;
  line-height: 1.4;
  font-style: normal;
  min-height: 100%;
  color: #272727;
  width: 100%;
  margin: 0;
  padding: 20px;
  background-color: #eee;
  overflow-x: hidden;

article {
  border-radius: 5px;
  border: 1px solid #c8c8c8;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
  padding: 1.5em;
  background: #f8f8f8;
  display: flow-root;

article + article {
  margin-top: 40px;

img {
  /* border: 1px solid; */
  float: left;
  width: 100%;
  height: auto;
  margin-right: 10px;
  max-width: 250px;

h2 {
  margin: 0 0 10px 0;
  line-height: 1.2;

.container {
  max-width: 900px;
  margin: auto;

.menu {
  display: flex;
  margin: 20px 0;

.menu > * {
  padding: 2px 0;
  font-size: 1rem;
  cursor: pointer;
  transition: box-shadow 200ms ease-in-out;

.menu > *:hover {
  border-bottom: 2px solid rgba(var(--color-hover), 0.8);

.menu > * + * {
  margin-left: 15px;

.type {
  text-transform: uppercase;

.menu .active {
  font-weight: 600;
  border-bottom: 2px solid rgba(var(--color-hover), 0.8);

.lemon-circle {
  shape-outside: circle(46.82% at center center);

.lemon-ellipse {
  shape-outside: ellipse(140px 110px at 45% 47.68%);

.lemon-url {
  shape-outside: url(;

.lemon-polygon {
  shape-outside: polygon(
    76.66% 28px,
    112.59% 25.28%,
    80.48% 33.6%,
    97.36% 58.85%,
    74.96% 87.69%,
    6.98% 101.83%,
    1px 50%,
    2.76% 7.07%

small {
  font-size: 1rem;
  line-height: 1.4;
  display: block;
  padding: 10px;



                const menu = document.querySelector(".menu");
const image = document.querySelector("img");
const type = document.querySelector(".type");

Array.from(menu.children).forEach((element) => {
  element.addEventListener("click", (e) => {
    const active = document.querySelector(".active");
    image.className = `lemon-${}`;
    type.textContent =;