Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <!-- (A) SIDEBAR -->
<div id="pgside">
  <!-- (A1) BRANDING OR USER -->
  <!-- LINK TO DASHBOARD OR LOGOUT -->
  <div id="pguser">
    <img src="https://images.unsplash.com/photo-1601412436009-d964bd02edbc?crop=entropy&cs=srgb&fm=jpg&ixid=M3wzMjM4NDZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE3MDE5NTcyNDF8&ixlib=rb-4.0.3&q=85">
    <i class="txt">MY ADMIN</i>
  </div>

  <!-- (A2) MENU ITEMS -->
  <a href="#" class="current">
    <i class="ico">&#9733;</i>
    <i class="txt">Section A</i>
  </a>
  <a href="#">
    <i class="ico">&#9728;</i>
    <i class="txt">Section B</i>
  </a>
  <a href="#">
    <i class="ico">&#9737;</i>
    <i class="txt">Section C</i>
  </a>
</div>

<!-- (B) MAIN -->
<main id="pgmain">
  <!-- (B1) FORM -->
  <h1>FORM</h1>
  <form class="form">
    <label for="demoA">Field A</label>
    <input type="text" id="demoA">

    <label for="demoB">Field B</label>
    <textarea id="demoB"></textarea>

    <label for="demoC">Field C</label>
    <select id="demoC">
      <option>Option A</option>
    </select>

    <input type="submit" value="Go">
  </form>
  
  <!-- (B2) ZEBRA TABLE -->
  <h1>ZEBRA TABLE</h1>
  <table class="zebra">
    <tr>
      <td>Cell</td> <td>Cell</td> <td>Cell</td>
    </tr>
    <tr>
      <td>Cell</td> <td>Cell</td> <td>Cell</td>
    </tr>
    <tr>
      <td>Cell</td> <td>Cell</td> <td>Cell</td>
    </tr>
  </table>
  
  <!-- (B3) ZEBRA LIST -->
  <h1>ZEBRA LIST</h1>
  <ul class="zebra">
    <li>Row</li> <li>Row</li>
    <li>Row</li> <li>Row</li>
  </ul>

  <!-- (X) NOT IMPORTANT -->
  <div id="cbinfo">Visit <a href="https://code-boxx.com/simple-html-css-admin-panel/" target="_blank">Code Boxx</a> for more details!</div>
</main>
              
            
!

CSS

              
                /* (A) GLOBAL */
* {
  font-family: Arial, Helvetica, sans-serif;
  box-sizing: border-box;
}
body {
  display: flex;
  min-height: 100vh;
  padding: 0; margin: 0;
}

/* (B) SIDEBAR */
/* (B1) SIDEBAR ITSELF */
#pgside {
  width: 200px;
  flex-shrink: 0;
  transition: width 0.2s;
  background: #283039;
}

/* (B2) USER OR BRANDING */
#pguser {
  display: flex;
  align-items: center;
  padding: 10px 5px;
}
#pguser img {
  width: 50px; height: 50px;
  object-fit: cover;
  margin-right: 10px;
  border-radius: 50%
}

/* (B3) SIDEBAR ITEMS */
#pgside, #pgside a { color: #fff; }
#pgside a {
  display: block;
  padding: 20px;
  width: 100%;
  text-decoration: none;
  cursor: pointer;
}
#pgside a.current { background: #7c1919; }
#pgside a:hover { background: #9b2323; }

/* (B4) SIDEBAR ICONS & TEXT */
#pgside i.ico, #pgside i.txt { font-style: normal; }
#pgside i.ico {
  font-size: 1.1em;
  margin-right: 10px;
}

/* (B5) SMALL SCREEN TRANSFORMATION */
@media screen and (max-width:768px) {
  #pgside { width: 70px; }
  #pgside i.txt { display: none; }
  #pgside i.ico {
    font-size: 1.5em;
    margin-right: 0;
  }
  #pguser { justify-content: center; }
  #pguser img { margin-right: 0; }
  #pgside a {
    text-align: center;
    padding: 20px 0;
  }
}

/* (C) MAIN CONTENTS */
#pgmain {
  flex-grow: 1;
  padding: 20px;
  background: #f2f2f2;
}

/* (D) EXTRA - FORMS */
.form {
  max-width: 600px; /* optional */
  padding: 20px;
  border: 1px solid #eee;
  background: #fff;
}
.form label, .form input, .form textarea, .form select, .form button {
  display: block;
  width: 100%;
}
.form label { padding: 10px 0; }
.form input, .form textarea, .form select { padding: 10px; }
input[type=button], input[type=submit], button {
  font-size: 1em;
  font-weight: 700;
  padding: 10px;
  border: 0;
  color: #fff;
  background: #870000;
  cursor: pointer;
}
input[type=submit] { margin-top: 20px; }

/* (E) ZEBRA TABLE */
table.zebra {
  width: 100%;
  border-collapse: collapse;
}
table.zebra tr:nth-child(odd) { background: #fff; }
table.zebra td { padding: 10px; }

/* (F) ZEBRA LIST */
ul.zebra, ol.zebra {
  padding: 0;
  margin: 0;
  list-style: none;
}
ul.zebra li, ol.zebra li { padding: 10px; }
ul.zebra li:nth-child(odd), ol.zebra li:nth-child(odd) { background: #fff; }

/* (X) NOT IMPORTANT */
#cbinfo{margin-top:30px;padding-top:15px;border-top:1px solid #ddd;font-size:13px;font-weight:700}
#cbinfo a{text-decoration:none;padding:5px;color:#fff;background:#a91616}
              
            
!

JS

              
                
              
            
!
999px

Console