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

              
                <div class="card">
   <div class="wrapper inner">
      <nav class="nav">
         <ul class="menu">
            <li class="menu__item">Vector</li>
            <li class="menu__item">Illustration</li>
            <li class="menu__item active">Images</li>
            <li class="menu__item">Icons</li>
         </ul>
      </nav>
      <main class="main">
         <header class="header">
            <div class="header__search">
               <input type="search" id="sr" name="sr" placeholder="Search">
               <span class="icon">
                  <svg xmlns="http://www.w3.org/2000/svg" width="26" height="26">
                     <g transform="translate(-2 -2)" fill="none" fill-rule="evenodd">
                        <path d="M0 0h30v30H0z" />
                        <circle cx="12.5" cy="12.5" r="8.75" stroke="#9BAAB7" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.875" />
                        <path stroke="#9BAAB7" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.875" d="M26.25 26.25l-7.5-7.5" />
                     </g>
                  </svg>

               </span>
            </div>
            <button class="header__btn">Upload</button>
         </header>
         <ul class="gal">
            <li class="gal__item"><img src="https://assets.codepen.io/2709552/1-gallery.jpg" />
               <div class="desc">
                  <div class="desc__content">
                     <h6>Girl Haidresser</h6>
                     <div class="desc__likes">
                        <span class="numbers">500 Likes 100 shares</span>
                     </div>
                  </div>
                  <div class="desc__icon">
                     <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="13" height="20">
                           <g fill="none" fill-rule="evenodd">
                              <path d="M-5.615-2.615h25.128v25.128H-5.615z" />
                              <path stroke="#FFF" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.571" d="M3.808 1.573h6.282c1.157 0 2.094.938 2.094 2.094v14.658l-5.235-3.14-5.235 3.14V3.667c0-1.156.938-2.094 2.094-2.094" />
                           </g>
                        </svg>
                     </span>
                  </div>
               </div>
            </li>
            <li class="gal__item"><img src="https://assets.codepen.io/2709552/2-gallery.jpg" />
               <div class="desc">
                  <div class="desc__content">
                     <h6>Dark Window</h6>
                     <div class="desc__likes">
                        <span class="numbers">100 Likes 20 shares</span>
                     </div>
                  </div>
                  <div class="desc__icon">
                     <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="13" height="20">
                           <g fill="none" fill-rule="evenodd">
                              <path d="M-5.615-2.615h25.128v25.128H-5.615z" />
                              <path stroke="#FFF" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.571" d="M3.808 1.573h6.282c1.157 0 2.094.938 2.094 2.094v14.658l-5.235-3.14-5.235 3.14V3.667c0-1.156.938-2.094 2.094-2.094" />
                           </g>
                        </svg>
                     </span>
                  </div>
               </div>
            </li>
            <li class="gal__item"><img src="https://assets.codepen.io/2709552/3-gallery.jpg" />
               <div class="desc">
                  <div class="desc__content">
                     <h6>Top Roof</h6>
                     <div class="desc__likes">
                        <span class="numbers">200 Likes 50 shares</span>
                     </div>
                  </div>
                  <div class="desc__icon">
                     <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="13" height="20">
                           <g fill="none" fill-rule="evenodd">
                              <path d="M-5.615-2.615h25.128v25.128H-5.615z" />
                              <path stroke="#FFF" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.571" d="M3.808 1.573h6.282c1.157 0 2.094.938 2.094 2.094v14.658l-5.235-3.14-5.235 3.14V3.667c0-1.156.938-2.094 2.094-2.094" />
                           </g>
                        </svg>
                     </span>
                  </div>
               </div>
            </li>
            <li class="gal__item"><img src="https://assets.codepen.io/2709552/4-gallery.jpg" />
               <div class="desc">
                  <div class="desc__content">
                     <h6>Abstract Painting</h6>
                     <div class="desc__likes">
                        <span class="numbers">245 Likes 35 shares</span>
                     </div>
                  </div>
                  <div class="desc__icon">
                     <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="13" height="20">
                           <g fill="none" fill-rule="evenodd">
                              <path d="M-5.615-2.615h25.128v25.128H-5.615z" />
                              <path stroke="#FFF" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.571" d="M3.808 1.573h6.282c1.157 0 2.094.938 2.094 2.094v14.658l-5.235-3.14-5.235 3.14V3.667c0-1.156.938-2.094 2.094-2.094" />
                           </g>
                        </svg>
                     </span>
                  </div>
               </div>
            </li>
            <li class="gal__item"><img src="https://assets.codepen.io/2709552/5-gallery.jpg" />
               <div class="desc">
                  <div class="desc__content">
                     <h6>Skyscrapers</h6>
                     <div class="desc__likes">
                        <span class="numbers">120 Likes 30 shares</span>
                     </div>
                  </div>
                  <div class="desc__icon">
                     <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="13" height="20">
                           <g fill="none" fill-rule="evenodd">
                              <path d="M-5.615-2.615h25.128v25.128H-5.615z" />
                              <path stroke="#FFF" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.571" d="M3.808 1.573h6.282c1.157 0 2.094.938 2.094 2.094v14.658l-5.235-3.14-5.235 3.14V3.667c0-1.156.938-2.094 2.094-2.094" />
                           </g>
                        </svg>
                     </span>
                  </div>
               </div>
            </li>
            <li class="gal__item"><img src="https://assets.codepen.io/2709552/6-gallery.jpg" />
               <div class="desc">
                  <div class="desc__content">
                     <h6>The Door</h6>
                     <div class="desc__likes">
                        <span class="numbers">220 Likes 40 shares</span>
                     </div>
                  </div>
                  <div class="desc__icon">
                     <span>
                        <svg xmlns="http://www.w3.org/2000/svg" width="13" height="20">
                           <g fill="none" fill-rule="evenodd">
                              <path d="M-5.615-2.615h25.128v25.128H-5.615z" />
                              <path stroke="#FFF" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.571" d="M3.808 1.573h6.282c1.157 0 2.094.938 2.094 2.094v14.658l-5.235-3.14-5.235 3.14V3.667c0-1.156.938-2.094 2.094-2.094" />
                           </g>
                        </svg>
                     </span>
                  </div>
               </div>
            </li>
         </ul>
      </main>
   </div>
</div>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css2?family=Muli:wght@400;700&display=swap");

:root {
   --black: #222729;

   box-sizing: border-box;
}
*,
*::before,
*::after {
   margin: 0;
   padding: 0;
   box-sizing: inherit;
}
html,
body {
   width: 100%;
   min-height: 100vh;
   font-size: 62.5%;
}
body {
   font-family: "Muli", sans-serif;
   font-size: 1.6rem;
   line-height: 1.6;
   background-color: #dde6ee;
   display: flex;
   justify-content: center;
   align-items: center;
}

img {
   max-width: 100%;
   display: block;
   height: auto;
}

ul {
   list-style: none;
}
.card {
   max-width: 1175px;
   width: 100%;
   height: 890px;
   margin: 0 auto;
   background-color: #fff;
   border-radius: 40px;
   padding-top: 52px;
   box-shadow: 30px 30px 70px rgba(#8fa5b9, 0.6),
      -30px -30px 70px rgba(white, 0.8);
}

.wrapper {
   max-width: 900px;
   width: 100%;
   padding: 0 1em;
   margin: 0 auto;
}

.nav {
   display: flex;
   align-items: center;
   justify-content: flex-end;
   flex-wrap: wrap;
}

.menu {
   display: flex;
   align-items: center;
}

.menu__item {
   display: inline-block;
   margin-left: 2.5em;
   position: relative;
   padding: 0.5em 0;
   cursor: pointer;
}

.menu__item::after {
   content: "";
   position: absolute;
   left: 0;
   bottom: 0;
   width: 100%;
   height: 2px;
   background-color: var(--black);
   transform: scaleX(0);
   transform-origin: center;
   transition: transform 350ms ease-in;
}

.menu__item:not(.active):hover::after {
   transform: scale(1);
}

.active::after {
   content: "";
   position: absolute;
   bottom: 0;
   left: 50%;
   transform: translatex(-50%);
   content: "";
   width: 20px;
   height: 2px;
   background-color: var(--black);
}

.header {
   margin: 84px 0;
   display: flex;
   align-items: center;
   justify-content: space-between;
   flex-wrap: wrap;
}

.header__search {
   display: flex;
   align-items: center;
   flex: 0 1 335px;
   position: relative;
}

.icon {
   display: inline-block;
   position: absolute;
   right: 1.4em;
}

input[type="search"] {
   border: none;
   font-family: inherit;
   padding: 1em 0.8em;
   border-bottom: 1px solid #c8d3dc;
   width: 100%;
   outline: none;
}

input:focus {
   outline: 2px solid #c8d3dc;
}
input::placeholder {
   font-size: 1.8rem;
   color: #9baab7;
}

.header__btn {
   display: inline-block;
   text-align: center;
   border: 0;
   font-family: inherit;
   outline: 0;
   background: transparent;
   background-color: var(--black);
   color: white;
   font-size: 1.8rem;
   padding: 15px 59px;
   border-radius: 5px;
   box-shadow: 0 11px 14px -10px rgba(#2e3336, 0.9);
}

.gal {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(275px, 1fr));
   gap: 1.5rem;
}

.gal__item img {
   object-fit: cover;
   width: 100%;
   height: 100%;
   cursor: pointer;
}

.gal__item {
   position: relative;
}

.gal__item:hover .desc {
   opacity: 1;
   transform: scale(1, 1);
   transform-origin: bottom;
}
.desc {
   position: absolute;
   bottom: 0;
   left: 0;
   right: 0;
   padding: 10px 15px;
   background-color: rgba(#132334, 0.5);
   color: white;
   display: flex;
   justify-content: space-between;
   align-items: center;
   opacity: 0;
   transform: scale(1, 0);
   transition: transform 300ms cubic-bezier(0.54, 0.02, 0.43, 0.93);
}

h6 {
   font-size: 1.4rem;
}

.numbers {
   font-size: 1.2rem;
}
@media (max-width: 650px) {
   .card {
      min-height: 100vh;
   }
   .nav {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-wrap: wrap;
   }
}

@media (max-width: 560px) {
   .card {
      height: 100vh;
      overflow-y: auto;
   }
   .header {
      margin: 84px 0;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-wrap: wrap;
   }
   .header__search {
      display: flex;
      align-items: center;
      flex: 0 1 335px;
      position: relative;
      margin-bottom: 2em;
   }

   .menu__item + .menu__item {
      display: inline-block;
      margin-left: 1.4em;
   }
   .header__btn {
      display: block;
      width: 100%;
   }

   .gal {
      margin-bottom: 3em;
   }
}

              
            
!

JS

              
                // Credit to https://uidesigndaily.com/posts/sketch-stock-photos-page-website-mockup-list-image-day-1132

              
            
!
999px

Console