Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                <!-- 
  try translating the website to another language
-->
 
<aside class="controls">
  <div>
    <h3>
      Document Direction <small>(block axis)</small>
    </h3>
    <select data-for="direction">
      <option value="ltr">left to right (ltr)</option>
      <option value="rtl">right to left (rtl)</option>
    </select>
  </div>
  <div style="text-align:end;"> 
    <h3>
      Writing Mode <small>(inline axis)</small>
    </h3>
    <select data-for="writing-mode">
      <option value="horizontal-tb">horizontal top to bottom (horizontal-tb)</option>
      <option value="vertical-rl">vertical right to left (vertical-rl)</option>
      <option value="vertical-lr">vertical left to right (vertical-lr)</option>
    </select>
  </div>
</aside>

<main>
  
  <section>
    <article>
      <h2>user experience agile development</h2>
      <p>Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition.</p>
      <p>Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps.</p>
    </article>
    <figure>
      <img src="https://picsum.photos/350/500?1" alt="" loading="lazy" width="350" height="500">
      <figcaption>A random image</figcaption>
    </figure>
  </section>
  
  <section>
    <article>
      <h2>Monetization launch party</h2>
      <p>Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment. Bring to the table win-win survival strategies to ensure proactive domination.</p>
    </article>
    <figure>
      <img src="https://picsum.photos/600/500?2" alt="" loading="lazy" width="600" height="500">
      <figcaption>A random image</figcaption>
    </figure>
  </section>
  
  <section>
    <article>
      <h2>MVP graphical user interface gamification</h2>
      <p>At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring.</p>
    </article>
    <figure>
      <img src="https://picsum.photos/500/500?3" alt="" loading="lazy" width="500" height="500">
      <figcaption>A random image</figcaption>
    </figure>
  </section>
  
  <section>
    <article>
      <h2>niche market bandwidth</h2>
      <p>Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line.</p>
      <p>Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinkingoverall value proposition.</p>
    </article>
    <figure>
      <img src="https://picsum.photos/600/400?4" alt="" loading="lazy" width="600" height="400">
      <figcaption>A random image</figcaption>
    </figure>
  </section>
  
</main>
              
            
!

CSS

              
                @use postcss-nested;

body { 
/*   direction: rtl; */
/*   writing-mode: vertical-rl; */
}

/* 
  Notes:
  - uses flexbox gap: try Chrome Canary or Firefox that have support
  - try changing the direction and writing modes
*/

h2 {
  line-height: 1.5;
  max-inline-size: 25ch;
  text-transform: capitalize;
  color: hsl(0 0% 20%);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
}

p {
  line-height: 2;
  max-inline-size: 45ch;
  color: hsl(0 0% 25%);
  font-size: clamp(1.1rem, 1.5vw, 1.25rem);
}

main {
  --container-gap: clamp(1rem, 5vw, 10vw);
  
  display: grid;
  gap: var(--container-gap);
}

section {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  gap: var(--container-gap);
  
  --column: 30ch;
  
  & > article {
    flex: 1 var(--column);
  }
  
  &:nth-child(odd) {
    flex-direction: row-reverse;
  }
  
  &:nth-child(even) {
    text-align: end;
    
    & > article {
      align-items: flex-end; 
    }
  }
}

article {
  display: grid;
  align-items: flex-start;
  gap: 2ch;
  
  & > :is(p,h2) {
    margin: 0;
  }
}

figure {
  margin: 0;
  flex: 1 1 var(--column); 
}

figure > img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: contain;
}

img {
  max-inline-size: 100%;
}












/* demo styles */
.controls {
  position: sticky;
  top: 5vw;
  display: flex;
/*   display: none; */
  flex-wrap: wrap;
  gap: 2ch;
  justify-content: space-between;
  padding: 2ch;
  background: white;
  border: 1px solid lightgray;
  margin-block-end: 5vmin;
  writing-mode: horizontal-tb;
  direction: ltr;
  
  & :is(h1,h2,h3,p) {
    margin: 0;
  }
}

body {
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 5vw;
  display: grid;
  justify-content: center;
}

figcaption {
  font-size: .9rem;
  text-align: center;
}
              
            
!

JS

              
                import $ from 'https://unpkg.com/[email protected]/src/index.js'

const [main] = $('body')

$('select').on('change', e => {
  const prop = $(e.target).attr('data-for')
  main.style[prop] = e.target.value
})
              
            
!
999px

Console