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


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


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.


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.



    <div id="container">
      <p>translation transform css3 & checkbox hack</p>

      <label for="show">MENU</label>


  <input type="checkbox" id="show">

  <nav class="toggle-nav">
      <li><a href="">Home</a></li>
      <li><a href="">About</a></li>
      <li><a href="">Service</a></li>
      <li><a href="">Contact</a></li>




body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #eee;
  overflow: hidden;

header {
  text-align: center;
  width: 100vw;
  height: 100px; // <- margin top of toggle nav
  position: absolute;
  background-color: white;
  border-bottom: 1px #000 solid;
  z-index: 100;

  h1 {
    margin-bottom: 0;
    font-size: 1.6rem;

  p {
    font-size: 0.6rem;

.toggle-nav {
  background: white;
  transform: translateY(-100%);
  transition: all 0.4s ease-out;
  z-index: 0;
  text-align: center;
  padding: 50px;
  position: absolute;
  left: 0;
  width: 100%;
  box-sizing: border-box;

  ul {
    list-style: none;
    padding: 0;
    margin: 0;

    li a {
      display: block;
      padding: 1%;
      text-decoration: none;
      border-bottom: 1px #ccc solid;

label {
  cursor: pointer;
  font-size: 0.8rem;
  border: 1px #000 solid;
  display: inline-block;
  height: 50px;
  width: 50px;
  line-height: 50px;
  text-align: center;
  z-index: 9999;
  position: absolute;
  top: 25px;
  right: 25px;

  &:hover {
    background: #efefef;

input[type="checkbox"] {
  display: none;

  &:checked ~ .toggle-nav {
    margin-top: 100px; // header height
    transform: translateY(0);
    height: 100vh;
    background: #ccc;

main {
  margin-top: 100px; // header height
  padding-top: 50px;
  text-align: center;


                //no js only checkbox hack