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

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

              
                <div id="root"></div>
              
            
!

CSS

              
                
              
            
!

JS

              
                import * as React from 'https://cdn.skypack.dev/react@^16.13.1';
import * as ReactDOM from 'https://cdn.skypack.dev/react-dom@^16.13.1';
import styled from 'https://cdn.skypack.dev/styled-components';

const FlexContainer = styled.div`
  display: flex;
  flex-direction: row;

  @media (max-width: 768px) {
    flex-direction: column;
  }
`

const Navigation = styled(FlexContainer)`
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  width: calc(100% - 20px);
`

const Footer = styled(Navigation)`
  justify-content: flex-end;
`

const NavItem = styled.a`
  border: 1px solid purple;
  color: purple;
  font-size: 20px;
  margin: 0 15px 20px 0;
  padding: 10px;
  
  &:hover {
    opacity: 0.6;
  }
`

const FooterNavItem = styled(NavItem)`
  border: 0;
  font-size: 12px;
  margin-bottom: 0;
  padding: 0;
`

const ContentWrapper = styled.div`
  padding: 50px 10px;
`

const LeftSideNav = styled(FlexContainer)`
  justify-content: space-evenly;
  order: 1;

  @media (max-width: 768px) {
    order: 2;
  }
`

const Logo = styled.img`
  margin-bottom: 20px;
  order: 2;
  
  @media (max-width: 768px) {
    order: 1;
  }
`

const App = () => (
    <>
      {/* Start App Navigation at top of page */}
      <Navigation>
        <LeftSideNav>
          <NavItem>Link Two</NavItem>
          <NavItem>Link Three</NavItem>
          <NavItem>Link Three</NavItem>
          <NavItem>Link Four</NavItem>
        </LeftSideNav>
        <Logo alt="Logo" src="https://assets.codepen.io/t-90/placeholder-logo.svg" />
      </Navigation>
      {/* End App Navigation at top of page */}
      <ContentWrapper>
         <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Expedita, reiciendis delectus. Iusto possimus quasi fuga. Adipisci earum ratione officia non, saepe fugit quidem cupiditate nihil dignissimos rem autem mollitia consequatur!</p>
      </ContentWrapper>
      {/* Start App Footer at the bottom of the page */}
      <Footer>
        <FooterNavItem>Footer Link One</FooterNavItem>
        <FooterNavItem>Footer Link Two</FooterNavItem>
      </Footer>
      {/* End App Footer at the bottom of the page */}
     </>
  );

ReactDOM.render(<App />,
document.getElementById("root"))
              
            
!
999px

Console