<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">

<div id="main">
  <div id="content">
  <span class="slide">
    <a href="#" onClick="openSlideMenu()">
    <i class="fas fa-bars"></i>
  <div id="menu" class="nav">
    <a href="#" class="close" onClick="closeSlideMenu()">
    <i class="fas fa-times"></i>
    <a href="#">Home</a>
    <a href="#">About</a>
    <a href="#">Services</a>
    <a href="#">Portfolio</a>
    <a href="#">Contact</a>

<div id="text">
  <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;

.nav {
  height: 100%;
  width: 0;
  position: fixed;
  z-index: 1;
  top: 0;
  left: 0;
  background-color: #111;
  opacity: 0.9;
  overflow-x: hidden;
  padding-top: 60px;
  transition: 0.7s;

.nav a {
  display: block;
  padding: 20px 30px;
  text-decoration: none;
  color: #ccc;
  font-size: 25px;
.nav a:hover {
  color: #fff;
  tansition: 0.4s;

.nav .close {
  position: absolute;
  top: 0;
  right: 22px;
  margin-left: 50px;
  font-size: 30px;

.slide a {
  color: #000;
  font-size: 36px;

#content {
  padding: 20px;
  transition: margin-left 0.7s;
  overflow: hidden;

#main {
  width: 100%;
  background-image: url(https://images.unsplash.com/photo-1549989476-69a92fa57c36?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=753&q=80);
  height: 100vh;
  background-position: center;
  background-size: cover;
  margin-bottom: 10px;

#text {
  width: 90%;
  padding: 5%;
function openSlideMenu () {
  document.getElementById('menu').style.width = '250px';
  document.getElementById('content').style.marginLeft = '250px';

function closeSlideMenu () {
  document.getElementById('menu').style.width = '0';
  document.getElementById('content').style.marginLeft = '0';

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.