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

              
                <div id="mySidenav" class="sidenav">
  <img alt='Avatar' class='avatar' img src='https://2.bp.blogspot.com/-WhPCdPhRwug/XwlGs3Ub7kI/AAAAAAAAAXM/wPCOm7UTXV8-YU8D9ShTzFaygW3cfKLRACK4BGAYYCw/s113/adel%2Band%2Bher%2Btab%2Bs2.jpg' itemprop='image' width='50px'/>
  
  <a href="javascript:void(0)" class="closebtn" onclick="closeNav()"><svg style="width:36px;height:36px" viewBox="0 0 36 24">
    <path fill="currentColor" d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" />
</svg></a>
  <a href="#">Perihal</a>
  <a href="#">Layanan</a>
  <a href="#">Klien</a>
  <a href="#">Hubungi</a>
</div>

<span style="font-size:30px;cursor:pointer" onclick="openNav()"><svg style="width:24px;height:24px" viewBox="0 0 24 20">
    <path fill="currentColor" d="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z" />
</svg>
</span>
<center><H1>BLOG SAYA</H1></center>

<div class="main">
  <h2>Sidebar Menu</h2>
  <p>Klik menu hamburger bagian atas kiri halaman ini untuk menampilkan menu pada bilah samping (sidebar) model menu ini sederhana, bersih dan tidak memberatkan loading halaman blog</p>
  <p>Sidebar ini tingginya juga bisa di ejas menjadi full atau otomatis mengikuti jumlah menu/submenu yang Anda buat.</p>
  <p>Model menu ini hanyalah bagi yang ingin membuat halaman tampak minimalis, lebih mobile dan lebih bersih..</p>
  <p>Di tulis: Adelina Sofyan</p>
</div>

              
            
!

CSS

              
                <style>
body {
  font-family: "Lato", sans-serif;
}

.sidenav {
  height: 100%;
  width: 0;
  position: fixed;
  z-index: 1;
  top: 0;
  left: 0;
  background-color: #fff;
  overflow-x: hidden;
  transition: 0s;
  padding-top: 60px;
}

.sidenav a {
  padding: 8px 8px 8px 32px;
  text-decoration: none;
  font-size: 25px;
  color: #333;
  display: block;
  transition: 0.3s;
}

.sidenav a:hover {
  color: #f1f1f1;
}

.sidenav .closebtn {
  position: absolute;
  top: 0;
  right: 200px;
  font-size: 36px;
  margin-left: 50px;
}

@media screen and (max-height: 450px) {
  .sidenav {padding-top: 15px;}
  .sidenav a {font-size: 18px;}
  }
  #main {
  margin-left: 200px; /* Same as the width of the sidenav */
  font-size: 20px; /* Increased text to enable scrolling */
  padding: 10px 20px;
}
HTML CSS JSResult Skip Results Iframe
EDIT ON
<style>body {
  font-family: "Lato", sans-serif;
}
.sidebar {
  height: 100%;
  width: 0;
  position: fixed;
  z-index: 1;
  top: 0;
  left: 0;
  background-color: #f0f0f0;
  overflow-x: hidden;
  transition: 0.5s;
  padding-top: 60px;
}
.sidebar a {
  padding: 8px 8px 8px 32px;
  text-decoration: none;
  font-size: 20px;
  color: #333;
  display: block;
  transition: 0.3s;
}
.sidebar a:hover {
  color: #f1f1f1;
}
.sidebar .closebtn {
  position: absolute;
  top: -0.1;
  right: 25px;
  font-size: 36px;
  margin-left: 50px;
  color: red;
}
.openbtn {
  font-size: 20px;
  cursor: pointer;
  background-color: #f0f0f0;
  color: #00CC00;
  padding: 10px 15px;
  border: none;
}
.openbtn:hover {
  background-color: #f0f0f0;
}
#main {
  transition: margin-left .5s;
  padding: 16px;
}

/* (Pada tampilan pada layar yang lebih kecil di mana ukuran tinggi kurang dari 450px, kita dapat merubah pengaturan CSS side navigasi misalnya dengan cara mengurangi padding dan mengecilkan ukuran huruf) */
@media screen and (max-height: 450px) {
  .sidebar {padding-top: 15px;}
  .sidebar a {font-size: 18px;}
}
.avatar{vertical-align:middle;width:50px;height:50px;border: none;color:transparent;border-radius:50%;margin-bottom:0px;margin-top:-10px;margin-left:33.33px;}
.avatar{background-color:pink;padding-top:0.9px;padding-bottom:1px;padding-left:0.9px;padding-right:0.9px;float:center;}
.avatar{animation: shake 2.5s;background-color:pink;
animation-iteration-count: infinite;

}
@keyframes shake {
0% { transform: translate(1px, 1px) rotate(0deg); }
10% { transform: translate(-1px, -2px) rotate(-1deg); }
20% { transform: translate(-3px, 0px) rotate(1deg); }
30% { transform: translate(3px, 2px) rotate(0deg); }
40% { transform: translate(1px, -1px) rotate(1deg); }
50% { transform: translate(-1px, 2px) rotate(-1deg); }
60% { transform: translate(-3px, 1px) rotate(0deg); }
70% { transform: translate(3px, 1px) rotate(-1deg); }
80% { transform: translate(-1px, -1px) rotate(1deg); }
90% { transform: translate(1px, 2px) rotate(0deg); }
100% { transform: translate(1px, -2px) rotate(-1deg); }
</style>

              
            
!

JS

              
                
function openNav() {
  document.getElementById("mySidenav").style.width = "254px";
}

function closeNav() {
  document.getElementById("mySidenav").style.width = "0";
}


              
            
!
999px

Console