Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <!DOCTYPE html>
<html>
   <head>
      <title>CSS is fun :)</title>
      
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
   </head>
   <body>
      
       <div class = "flex">
          <article class = "article">
            <p>Quisque fringilla massa mauris, nec aliquet purus maximus eu. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam convallis, ante vel ullamcorper eleifend, diam turpis semper arcu, eget sodales arcu velit vel ex. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Cras vitae varius nisl. Cras semper eu sapien eget congue. Aenean bibendum orci ut purus euismod ultricies. Phasellus dolor arcu, tempus vel rutrum in, blandit at mi. Mauris sem justo, lacinia eu ante et, lacinia rhoncus mi. Maecenas in blandit ante. Pellentesque cursus rutrum ante, at imperdiet quam accumsan nec.</p>
          </article>
          <aside class = "sidebar">
            <section class = "section">
              
              <form method="post" action="/login">
                <label for= "username">Username: <input type="text" placeholder="username" id = "username"></label>
                <label for= "password">Password: <input type="text" placeholder="password" id = "password"></label>
                <input type="submit" value = "Login">
              </form>
            </section>
            <section class = "section">
              <h2>Other items</h2>
              <ul>
                <li> Item A</li>
                <li> Item B</li>
                <li> Item C</li>
                <li> Item D</li>
                <li> Item E</li>
              </ul>
            </section>
          </aside>
       </div>
       <h1>Applying another value for flex-direction</h1>
       <div class = "flex1">
          <article class = "article">
            <p>Quisque fringilla massa mauris, nec aliquet purus maximus eu. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam convallis, ante vel ullamcorper eleifend, diam turpis semper arcu, eget sodales arcu velit vel ex. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Cras vitae varius nisl. Cras semper eu sapien eget congue. Aenean bibendum orci ut purus euismod ultricies. Phasellus dolor arcu, tempus vel rutrum in, blandit at mi. Mauris sem justo, lacinia eu ante et, lacinia rhoncus mi. Maecenas in blandit ante. Pellentesque cursus rutrum ante, at imperdiet quam accumsan nec.</p>
          </article>
          <aside class = "sidebar1">
            <section class = "section">
              
              <form method="post" action="/login">
                <label for= "username1">Username: <input type="text" placeholder="username" id = "username1"></label>
                <label for= "password1">Password: <input type="text" placeholder="password" id = "password1"></label>
                <input type="submit" value = "Login">
              </form>
            </section>
            <section class = "section">
              <h2>Other items</h2>
              <ul>
                <li> Item A</li>
                <li> Item B</li>
                <li> Item C</li>
                <li> Item D</li>
                <li> Item E</li>
              </ul>
            </section>
          </aside>
       </div>
       
   </body>
</html> 

              
            
!

CSS

              
                      *, ::after, ::before{
           margin:unset;
           box-sizing: border-box;
           
       }
       
      .flex{
        display: flex;
        flex-direction:row;
        border:thin solid;
      }
      .flex1{
        display: flex;
        flex-direction:row-reverse;
        border:thin solid;
      }
      .article{
        flex:2 1 200px;
        background-color: ghostwhite;
        border:thin solid lightgray;
      }
      .sidebar{
        flex:1 1 100px;
        background-color: ghostwhite;
        border:thin solid lightgray;

        display: flex;
        flex-direction: column;
      }
      .sidebar1{
        flex:1 1 100px;
        background-color: ghostwhite;
        border:thin solid lightgray;

        display: flex;
        flex-direction: column-reverse;
      }
      .section{
        border:thin solid gray;
        flex:1;
      }

              
            
!

JS

              
                
              
            
!
999px

Console