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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

  <nav id="nav-global">
    <a href="#">Home</a>
    <a href="#">World</a>
    <a href="#">Technology</a>
    <a href="#">Business</a>
    <a href="#">Travel</a>
    <a href="#">Environment</a>
    <a href="#">Comment</a>
    <a href="#">Sport</a>
    <a href="#">Life & style</a>

  <div id="menu">
    <a href="#" class="toggle"></a>
    <aside class="visible">
      <nav id="nav-compact">
        <!-- #global nav items will flow here -->
        Overflow menu items will appear above.
  <h1>Responsive menu using CSS Regions</h1>

  <p class="warning">
        This example demonstrates cutting-edge features that the <a href="" target="_blank">Adobe Web Platform Team</a> is working on. To see these features in action, <a href="" target="_blank">enable CSS Regions</a> in a browser which supports them:
        <a href="" target="_blank">CSS Regions Support Matrix</a>.      
  <p class="instructions">Resize the viewport and observe the menus.</p>
  <p class="instructions">
    This example demonstrates how to use <a href="" target="_blank">CSS Regions</a> to flow menu items into a side-menu when they don't fit the main menu.
  Don't have CSS Regions? Watch a <a href="" target="_blank">video demo</a> by <a href="" target="_blank">@simevidas</a>.
  <p>Inspired by the <a href="" target="_blank">The Guardian</a>'s responsive menu. Built by <a href="" target="_blank">@razvancaliman</a>.
              body, html{
  margin: 0;
  padding: 0;

#nav-global a:hover{
  text-decoration: underline;

  box-sizing: border-box;
  display: flex;
  height: 3rem;
  border-bottom: 1px solid #E3E3DB;
  background: #F4F4EE;

  height: 3rem;
  flex: 1 1 auto;
  padding-left: 3rem;

#nav-global a{
  text-decoration: none;
  margin-right: 1.3rem;
  padding: 0.5rem 0 0;
  float: left;
  color: #333;
  font: 1.3rem/1.9rem normal georgia,serif;

  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 4rem;
  position: relative;
  background: #214583;

#menu aside{
  visibility: hidden; /* toggled by JavaScript */
  background: #214583;
  width: 10rem;
  padding: 0.5rem 1rem 1rem;
  position: absolute;
  top: calc(3rem - 1px);
  border: none;
  right: 0;

#menu aside.visible{
  visibility: visible;

#menu em{
  display: block;
  margin: 1rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid #E24D4D;
  color: rgba(252,252,252,0.7);
  font-family: helvetica, arial, serif;

#menu .toggle{
  display: block;
  width: 4rem;
  height: 3rem; 
  background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTIiIHdpZHRoPSIxOCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAuNSAxOCAxMiIgdmlld0JveD0iMCAwLjUgMTggMTIiPjxyZWN0IHk9Ii41IiB3aWR0aD0iMTgiIGhlaWdodD0iMiIgZmlsbD0iI2ZmZiIvPjxyZWN0IHk9IjUuNSIgd2lkdGg9IjE4IiBoZWlnaHQ9IjIiIGZpbGw9IiNmZmYiLz48cmVjdCB5PSIxMC41IiB3aWR0aD0iMTgiIGhlaWdodD0iMiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==);
  background-position: center center;
  background-repeat: no-repeat;

/* collect all nav links */
#nav-global a{
  flow-into: menu;

/* reflow nav links into original container and overflow into another element */
  flow-from: menu;

/* region-styling for overflow region */
@-webkit-region #nav-compact{
  #nav-global a{
    color: white;

  padding: 1rem 3rem;
  width: 50%;

  background: #ffc;
  color: black;
  padding: 1em;
  margin: 0 0 0 -1em;
  display: none;

.no-flow-into .instructions{
  display: none;
.no-flow-into .warning{
  display: block;

  font: 2.5rem/2.8rem normal georgia, serif;

  color: #444;
  font: 1.2rem/1.6rem normal georgia, serif;
              var toggle = document.querySelector('.toggle'),
    aside = document.querySelector('aside');
toggle.addEventListener('click', function(){

var property = "flow-into";

// check if any variant exists, prefixed or not
var isCapable = ['-webkit-','-ms-','-moz-',''].some(function(prefix){
  return prefix + property in 

property = isCapable ? property : 'no-' + property;
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.