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

              
                <header>
  <svg class="horizontal" width="293px" height="56px" viewBox="0 0 293 56" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>Code Red Logo &amp; Name</title>
    <desc>Logo is a forwad slash in pointy brackets</desc>
    <g id="Welcome" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
      <g id="Mobile-Portrait---Menu-Open">
        <g id="Logo-&amp;-Name" transform="translate(146.500000, 28.000000) rotate(-90.000000) translate(-146.500000, -28.000000) translate(119.500000, -117.500000)">
          <path d="M172.5,118.5 L172.5,172.5 L-91.5,172.5 C-106.411688,172.5 -118.5,160.411688 -118.5,145.5 C-118.5,130.588312 -106.411688,118.5 -91.5,118.5 L-91.5,118.5 L172.5,118.5 Z" id="Combined-Shape" stroke="#D0021B" fill="#FFFFFF" transform="translate(27.000000, 145.500000) rotate(90.000000) translate(-27.000000, -145.500000) "></path>
          <g id="angle" transform="translate(26.500000, 26.500000) rotate(90.000000) translate(-26.500000, -26.500000) translate(4.000000, 4.000000)">
            <circle id="Oval" fill="#D0021B" cx="22.5" cy="22.5" r="22.5"></circle>
            <text id="&lt;/&gt;" font-family="CourierNewPS-BoldMT, Courier New" font-size="15.5889145" font-weight="bold" letter-spacing="1.03926095" fill="#FFFFFF">
              <tspan x="6.88282042" y="26.6662818">&lt;/&gt;</tspan>
            </text>
          </g>
          <text id="code–red.uk" transform="translate(26.500000, 167.500000) rotate(90.000000) translate(-26.500000, -167.500000) " font-family="CourierNewPSMT, Courier New" font-size="35.1219512" font-weight="normal" letter-spacing="2.34146345">
            <tspan x="-91.5400766" y="174" fill="#000000">code–</tspan>
            <tspan x="25.5502437" y="174" font-family="HelveticaNeue-Bold, Helvetica Neue" font-weight="bold" fill="#D0021B">red.uk</tspan>
          </text>
        </g>
      </g>
    </g>
  </svg>
  <button id="menuButton" onclick="menuToggle()" name="menu">Menu☰</button>
  <nav class="hidden" id="menu">
    <ul>
      <li>Ethos</li>
      <li>Services</li>
      <li>Work</li>
      <li>Case Studies</li>
      <li>Blog</li>
      <li>Contact</li>
      <li><a href="#" onclick="menuToggle()">Close X</a></li>
    </ul>
  </nav>
</header>
              
            
!

CSS

              
                html {
  margin: 0;
  padding: 0;
  font-szie: 16px;
}
body {
  margin: auto;
  width: 320px;
  background-color: #FAF9F9;
}

header {
  position: relative;
  top: 0px; left 0;
  height: 45px;
  width: 100%;
  background-color: #D0021B;
  padding: 5px;
  margin: 0 0 0 27px;
}

svg {
  position: absolute;
  top: 1px; left: -30px;
  z-index: 10;
  
}

header.open svg {
  transform-origin: 28px 28px;
  transform: rotate(0deg);
  transition-delay: 0s;
}

header svg {
  transform-origin: 28px 28px;
  transform: rotate(90deg);
  transition: transform 2s ease;
  transition-delay: 2s;
}

button {
  background-color: #D0021B;
  color: #FAF9F9;
  font-family: 'Courier New';
  font-size: 2em;
  Font-weight: 700;
  text-decoration: underline;
  border: none;
  margin: 5px 0 0 30px;
  cursor: pointer;
}

button.hidden {
  color: #D0021B;
}

nav {
  max-height: 500px;
  transition: max-height 2s ease;
  transition-delay: 2s;
  overflow: hidden;
  margin-top: -40px;
  margin-left: -32px;
}

nav ul {
  background-color: #D0021B;
  color: #FAF9F9;
  font-family: 'Courier New';
  Font-weight: 700;
  font-size: 2em;
  list-style: none;
  margin: 23px 0 0 -27px;
  padding: 35px 10px 10px 33px; 
  border-radius: 0 0 23px 0;
}

nav ul a {
  color: #FAF9F9;
}

nav ul a:hover {
  background-color: #FAf9f9;
  color: #D0021B;
}

nav.hidden {
  max-height: 0;
  transition-delay: 0s;
}

/* Fallback for reduced-motion, no transition or no JavaScript
@media (prefers-reduced-motion) {
  nav.hidden {
    max-height: 500px;
  }
  header svg {
    transform: rotate(-90deg);
  }
}

@supports not (transition) {
  nav.hidden {
    max-height: 500px;
  }
}

.no-js nav.hidden {
  max-height: 500px;
 }
.no-js header svg {
  transform: rotate(-90deg);
}
*/
              
            
!

JS

              
                const menuButton = document.querySelector("#menuButton");
const nav = document.querySelector("#menu");
const header = document.querySelector("header");

function menuToggle() {
  menuButton.classList.toggle("hidden");
  nav.classList.toggle("hidden");
  header.classList.toggle("open");
}

              
            
!
999px

Console