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 id="top">
<nav class="flex justify-between my-4 mx-8 uppercase font-bold">
  <h1 class="text-2xl">Melissa Smith</h1>
  <a id="plus" class="cursor-pointer"><h1 class="text-2xl hidden md:block">Information</h1></a>
  </a>
</nav>
<div id="dropdown" class="hidden w-screen mt-20 flex-col md:flex-row justify-start md:justify-around items-center md:items-start text-center">
  <div class="flex flex-col md:w-1/3">
    <h2 class="my-4 text-2xl uppercase font-bold">About</h2>
    <p class="text-base mx-4 md:mx-0 pb-4">Lorem ipsum dolor sit amet consectetur adipisicing elit. Corporis ipsam ullam laudantium quia quibusdam, eligendi aliquam atque provident quasi rerum, omnis sint tempore perspiciatis cum!</p>
    <p>1-800-555-1234</p>
    <a href="#">melissa@photography.com</a>
  </div>
  <div class="flex flex-col md:w-1/3 pt-4 md:pt-0">
    <ul>
      <h2 class="my-4 text-2xl uppercase font-bold">Equipment</h2>
      <li>Nikon</li>
      <li>Canon</li>
      <li>GoPro</li>
      <li>Olympus</li>
    </ul>
  </div>
  <div class="flex flex-col pt-4 md:pt-0">
    <h2 class="my-4 text-xl uppercase font-bold">Social</h2>
    <div class="flex">
    <a href="#"><i class="pr-4 text-3xl fab fa-instagram"></i></a>
    <a href="#"><i class="text-3xl fab fa-facebook"></i></a>
    </div>
  </div> 
</div>
  </header>

<main class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-2 my-12 mx-8">

  <!-- Begin Project Grid -->
  <section style="background-image: url(https://i.imgur.com/NOUGyc2.jpg)" class="col-span-1 md:col-span-2 row-span-1 md:row-span-3 gap-4 relative bg-cover bg-center">
  <div class="absolute bottom-8 left-8 text-gray-100 uppercase">
    <h1 class="text-2xl md:text-4xl font-bold">Northern Lights</h1>
    <h3 class="text-base">October 2020</h3>
    </div>
     <div class="img-overlay absolute inset-0 h-full w-full opacity-0">
    <a href="#" class="absolute inset-0 text-center text-5xl text-gray-100 transform translate-y-1/2">
      <i class="fas fa-images"></i>
      <h2 class="text-2xl">View Project</h2>
    </a>
  </div>
</section>
<section style="background-image: url(https://i.imgur.com/go84R4h.jpg)" class="row-span-1 md:row-span-2 gap-4 relative bg-cover bg-center" >  
  <div class="absolute bottom-8 left-8 text-gray-100 uppercase">
     <h1 class="text-2xl md:text-4xl font-bold">Bakery</h1>
    <h3 class="text-base">May 2020</h3>
  </div>  
  <div class="img-overlay absolute inset-0 h-full w-full opacity-0">
    <a href="#" class="absolute inset-0 text-center text-5xl text-gray-100 transform translate-y-1/2">
      <i class="fas fa-images"></i>
      <h2 class="text-2xl">View Project</h2>
    </a>
  </div>
</section>
<section style="background-image: url(https://i.imgur.com/pjDQJcs.jpg)" class="row-span-1 md:row-span-2 gap-4 relative bg-cover bg-center">
  <div class="absolute bottom-8 left-8 text-gray-100 uppercase">
     <h1 class="text-2xl md:text-4xl font-bold">Africa</h1>
    <h2 class="text-base">June 2020</h2>
  </div>
  <div class="img-overlay absolute inset-0 h-full w-full opacity-0">
    <a href="#" class="absolute inset-0 text-center text-5xl text-gray-100 transform translate-y-1/2">
      <i class="fas fa-images"></i>
      <h2 class="text-2xl">View Project</h2>
    </a>
  </div>
</section>
<section style="background-image: url(https://i.imgur.com/0CFiVId.jpg)" class="col-span-1 md:col-span-2 gap-4 relative bg-cover bg-center">
  <div class="absolute bottom-8 left-8 text-gray-100 uppercase">
     <h1 class="text-2xl md:text-4xl font-bold">Chicago</h1>
    <h2 class="text-base font-semibold">May 2020</h2>
  </div>
  <div class="img-overlay absolute inset-0 h-full w-full opacity-0">
    <a href="#" class="absolute inset-0 text-center text-5xl text-gray-100 transform translate-y-1/2">
      <i class="fas fa-images"></i>
      <h2 class="text-2xl">View Project</h2>
    </a>
  </div>
</section>
<section style="background-image: url(https://i.imgur.com/Ip7cQGo.jpg)" class="gap-4 relative bg-cover bg-top">
  <div class="absolute bottom-8 left-8 text-gray-100 uppercase">
     <h1 class="text-2xl md:text-4xl font-bold">Cannabiz</h1>
    <h2 class="text-base">August 2019</h2>
  </div>
  <div class="img-overlay absolute inset-0 h-full w-full opacity-0">
    <a href="#" class="absolute inset-0 text-center text-5xl text-gray-100 transform translate-y-1/2">
      <i class="fas fa-images"></i>
      <h2 class="text-2xl">View Project</h2>
    </a>
  </div>
</section>
<section style="background-image: url(https://i.imgur.com/tf2npG4.jpg)" class="gap-4 relative bg-cover bg-center">
  <div class="absolute bottom-8 left-8 text-gray-100 uppercase">
     <h1 class="text-2xl md:text-4xl font-bold">Alaska</h1>
    <h2 class="text-base">August 2019</h2>
  </div>
  <div class="img-overlay absolute inset-0 h-full w-full opacity-0">
    <a href="#" class="absolute inset-0 text-center text-5xl text-gray-100 transform translate-y-1/2">
      <i class="fas fa-images"></i>
      <h2 class="text-2xl">View Project</h2>
    </a>
  </div>
</section>
<section style="background-image: url(https://i.imgur.com/3SmMHed.jpg)" class="gap-4 relative bg-cover bg-center">
   <div class="absolute bottom-8 left-8 text-gray-100 uppercase">
      <h1 class="text-2xl md:text-4xl font-bold">Pacific Ocean</h1>
      <h2 class="text-base">March 2020</h2>
  </div>
  <div class="img-overlay absolute inset-0 h-full w-full opacity-0">
    <a href="#" class="absolute inset-0 text-center text-5xl text-gray-100 transform translate-y-1/2">
      <i class="fas fa-images"></i>
      <h2 class="text-2xl">View Project</h2>
    </a>
  </div>
</section>
<section style="background-image: url(https://i.imgur.com/tnkVjaH.jpg)" class="gap-4 relative bg-cover bg-center">
  <div class="absolute bottom-8 left-8 text-gray-100 uppercase">
     <h1 class="text-2xl md:text-4xl font-bold">Florida</h1>
    <h2 class="text-base font-semibold">December 2019</h2>
  </div>
  <div class="img-overlay absolute inset-0 h-full w-full opacity-0">
    <a href="#" class="absolute inset-0 text-center text-5xl text-gray-100 transform translate-y-1/2">
      <i class="fas fa-images"></i>
      <h2 class="text-2xl">View Project</h2>
    </a>
  </div>
</section>

<section style="background-image: url(https://i.imgur.com/ivIXRAr.jpg)" class="gap-4 relative bg-cover bg-center">
  <div class="absolute bottom-8 left-8 text-gray-100 uppercase">
     <h1 class="text-2xl md:text-4xl font-bold">Vancouver</h1>
    <h2 class="text-base">September 2020</h2>
  </div>
  <div class="img-overlay absolute inset-0 h-full w-full opacity-0">
    <a href="#" class="absolute inset-0 text-center text-5xl text-gray-100 transform translate-y-1/2">
      <i class="fas fa-images"></i>
      <h2 class="text-2xl">View Project</h2>
    </a>
  </div>
</section>
<section style="background-image: url(https://i.imgur.com/hpnsdty.jpg)" class="gap-4 relative bg-cover bg-center">
  <div class="absolute bottom-8 left-8 text-gray-100 uppercase">
     <h1 class="text-2xl md:text-4xl font-bold">Japan</h1>
    <h2 class="text-base">July 2020</h2>
  </div>
  <div class="img-overlay absolute inset-0 h-full w-full opacity-0">
    <a href="#" class="absolute inset-0 text-center text-5xl text-gray-100 transform translate-y-1/2">
      <i class="fas fa-images"></i>
      <h2 class="text-2xl">View Project</h2>
    </a>
  </div>
</section>
<section style="background-image: url(https://i.imgur.com/snIN0FA.jpg)" class="col-span-1 row-span-1 md:col-span-2 md:row-span-2 gap-4 relative bg-cover bg-center">
  <div class="absolute bottom-8 left-8 text-gray-100 uppercase">
     <h1 class="text-2xl md:text-4xl font-bold">Denmark</h1>
    <h2 class="text-base font-semibold">April 2020</h2>
  </div>
  <div class="img-overlay absolute inset-0 h-full w-full opacity-0">
    <a href="#" class="absolute inset-0 text-center text-5xl text-gray-100 transform translate-y-1/2">
      <i class="fas fa-images"></i>
      <h2 class="text-2xl">View Project</h2>
    </a>
  </div>
</section>
<section style="background-image: url(https://i.imgur.com/lKnOCsT.jpg)" class="col-span-1 md:col-span-2 gap-4 relative bg-cover bg-center">
  <div class="absolute bottom-8 left-8 text-gray-100 uppercase">
     <h1 class="text-2xl md:text-4xl font-bold">Hawaii</h1>
    <h2 class="text-base">January 2020</h2>
  </div>
  <div class="img-overlay absolute inset-0 h-full w-full opacity-0">
    <a href="#" class="absolute inset-0 text-center text-5xl text-gray-100 transform translate-y-1/2">
      <i class="fas fa-images"></i>
      <h2 class="text-2xl">View Project</h2>
    </a>
  </div>
</section>
<section style="background-image: url(https://i.imgur.com/X6eHpci.jpg)" class="col-span-1 md:col-span-2 row-span-1 md:row-span-2 gap-4 relative bg-cover bg-center">
  <div class="absolute bottom-8 left-8 text-gray-100 uppercase">
     <h1 class="text-2xl md:text-4xl font-bold">Arizona</h1>
    <h2 class="text-base">November 2019</h2>
  </div>
  <div class="img-overlay absolute inset-0 h-full w-full opacity-0">
    <a href="#" class="absolute inset-0 text-center text-5xl text-gray-100 transform translate-y-1/2">
      <i class="fas fa-images"></i>
      <h2 class="text-2xl">View Project</h2>
    </a>
  </div>
</section>
<section style="background-image: url(https://i.imgur.com/pKxwCpK.jpg)" class="gap-4 relative bg-cover bg-center">
  <div class="absolute bottom-8 left-8 text-gray-100 uppercase">
     <h1 class="text-2xl md:text-4xl font-bold">Nevada</h1>
    <h2 class="text-base">October 2019</h2>
  </div>
  <div class="img-overlay absolute inset-0 h-full w-full opacity-0">
    <a href="#" class="absolute inset-0 text-center text-5xl text-gray-100 transform translate-y-1/2">
      <i class="fas fa-images"></i>
      <h2 class="text-2xl">View Project</h2>
    </a>
  </div>
</section>
<section style="background-image: url(https://i.imgur.com/UfVTNMg.jpg)" class="gap-4 relative bg-cover bg-center">
  <div class="absolute bottom-8 left-8 text-gray-100 uppercase">
     <h1 class="text-2xl md:text-4xl font-bold">Russia</h1>
    <h2 class="text-base">August 2020</h2>
  </div>
  <div class="img-overlay absolute inset-0 h-full w-full opacity-0">
    <a href="#" class="absolute inset-0 text-center text-5xl text-gray-100 transform translate-y-1/2">
      <i class="fas fa-images"></i>
      <h2 class="text-2xl">View Project</h2>
    </a>
  </div>
</section>
<section style="background-image: url(https://i.imgur.com/4ENNSFV.jpg)" class="gap-4 relative bg-cover bg-center">
  <div class="absolute bottom-8 left-8 text-gray-100 uppercase">
     <h1 class="text-2xl md:text-4xl font-bold ">London</h1>
    <h2 class="text-base">April 2020</h2>
  </div>
  <div class="img-overlay absolute inset-0 h-full w-full opacity-0">
    <a href="#" class="absolute inset-0 text-center text-5xl text-gray-100 transform translate-y-1/2">
      <i class="fas fa-images"></i>
      <h2 class="text-2xl">View Project</h2>
    </a>
  </div>
</section>
<section style="background-image: url(https://i.imgur.com/MpiFRSm.jpg)" class="gap-4 relative bg-cover bg-center">
  <div class="absolute bottom-8 left-8 text-gray-100 uppercase">
     <h1 class="text-2xl md:text-4xl font-bold">Tennessee</h1>
    <h2 class="text-base">March 2020</h2>
  </div>
  <div class="img-overlay absolute inset-0 h-full w-full opacity-0">
    <a href="#" class="absolute inset-0 text-center text-5xl text-gray-100 transform translate-y-1/2">
      <i class="fas fa-images"></i>
      <h2 class="text-2xl">View Project</h2>
    </a>
  </div>
</section>
  
  <!-- End Project Grid -->
</main>

<footer class="flex flex-cols justify-center text-center my-8">
  <a href="#top"><i class="text-2xl fas fa-chevron-up"></i>
  <p class="text-xl">Back To Top</p></a>
</footer>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=PT+Sans:wght@400;700&display=swap');

html {
  scroll-behavior: smooth;
} 

body {
  font-family: 'PT Sans', sans-serif;
  background-color: #121212;
  color: #ededed;
}

main {
    grid-auto-rows: minmax(300px, auto);
    grid-auto-flow: dense;
}

section {
  cursor: pointer;
  border-radius: 2px;
}

.img-overlay {
  transition: .3s ease-in;
  background-color: rgba(0,0,0,0.65);
}

section:hover .img-overlay {
  opacity: 1;
}

h1, h2 {
  font-family: 'Bebas Neue', cursive;
  letter-spacing: 2px;
}

.show {
  display: flex;
  height: 50vh;
} 

@media screen and (max-width: 480px) {
  .show {
    height: 100%;
  }
}

#plus {
  position: relative;
}

nav a:before {
  position: absolute;
  top: 4px;
  right: 110%;
  font-family: 'Font Awesome\ 5 Free';
  content: "\f067"; /* FontAwesome Unicode */
}


              
            
!

JS

              
                let plus = document.getElementById('plus');

let dropdown = document.getElementById('dropdown');

plus.addEventListener('click', function(){
  dropdown.classList.toggle('show');
});

              
            
!
999px

Console