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

              
                <!-- Nav bar -->
    <nav class="navbar">
        <div aria-labelledby="navigation-menu">
            <ul class="navbar__navigation">
               
                <li>
                    <a href="#">Home</a>
                </li>
                <li>
                    <a href="#">About</a>
                </li>
                <li>
                    <a href="#" target="_blank">Products</a>
                </li>
                <li>
                    <a href="#" target="_blank">Contact</a>
                </li>
            </ul>
        </div>
        <div class="navbar__social-media">
            <ul class="navbar__links">
                <i class="fab fa-twitter "><a aria-label="twitter" href="#"></a></i>
                <i class="fab fa-linkedin"><a aria-label="linkedin" href="#"></a></i>
                <i class="fab fa-github"><a aria-label="github" href="#"></a></i>
            </ul>
        </div>
    </nav>
    <!-- Heading -->
    <header class="title">
        <h1>Good Stuff Foods</h1>
   </header>

    <!-- Grid -->
    <section class="container">
       
        <div>
            <img src="https://images.unsplash.com/photo-1482049016688-2d3e1b311543?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="First description" />
            <span class="description">First description</span>
        </div>
        <div>
            <img src="https://images.unsplash.com/photo-1484723091739-30a097e8f929?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="Second description">
            <span class="description">Second description</span>
        </div>
        <div>
            <img src="https://images.unsplash.com/photo-1540189549336-e6e99c3679fe?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="Third description">
            <span class="description">Third description
            </span>
        </div>
        <div>
            <img src="https://images.unsplash.com/photo-1476718406336-bb5a9690ee2a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="Fourth description">
            <span class="description">Fourth description</span>
        </div>
        <div>
            <img src="https://images.unsplash.com/photo-1506354666786-959d6d497f1a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="Fifth description">
            <span class="description">Fifth description</span>
        </div>
        <div>
            <img src="https://images.unsplash.com/photo-1478145046317-39f10e56b5e9?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="Sixth description">
            <span class="description">Sixth description</span>
        </div>
        <div>
            <img src="https://images.unsplash.com/photo-1467003909585-2f8a72700288?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="Seventh description">
            <span class="description">Seventh description</span>
        </div>
        <div>
            <img src="https://images.unsplash.com/photo-1529042410759-befb1204b468?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="Eighth description">
            <span class="description">Eighth description</span>
        </div>
        <div>
            <img src="https://images.unsplash.com/photo-1484980972926-edee96e0960d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="Ninth description">
            <span class="description">Ninth description</span>
        </div>
        <div>
            <img src="https://images.unsplash.com/photo-1432139509613-5c4255815697?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="Tenth description">
            <span class="description">Tenth description</span>
        </div>
        <div>
            <img src="https://images.unsplash.com/photo-1485962398705-ef6a13c41e8f?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="Eleventh description">
            <span class="description">Eleventh description</span>
        </div>
        <div>
            <img src="https://images.unsplash.com/photo-1458642849426-cfb724f15ef7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" alt="Twelfth description">
            <span class="description">Twelfth description</span>
        </div>
    </section>

    <footer class="footer">
        <h2 class="footer__tagline-title">
            Good Stuff - <span class="footer__tagline">If it's good it's here</span> by
            <span>Ricardo Moreira</span>
        </h2>
    </footer>


              
            
!

CSS

              
                html,
body {
  background-color: #eceee5;
}

/* Navbar*/
.navbar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  align-content: flex-start;
}

ul {
  list-style: none;
  margin: 0px;
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}
a {
  text-decoration: none;
  display: block;
  padding: 1em;
  color: #c8882d;
  font-size: 18px;
  font-family: Lora;
}

a:hover {
  border-bottom: 1px #20263f solid;
}

.navbar__social-media {
  display: flex;
  justify-content: space-between;
}
.navbar__links i {
  margin: 0px;
  color: #c8882d;
  font-size: 18px;
}
.navbar__links i:hover {
  border-bottom: 1px #20263f solid;
}

.navigation li:hover {
  background-color: #20263f;
}

/* Title Format */
h1 {
  color: #20263f;
  font-family: "Dosis", sans-serif;
  font-weight: 400;
  font-size: 50px;
  display: block;
}
.title {
  text-align: left;
  justify-content: left;
  width: 100%;
  height: 75px;
  margin-bottom: 30px;
  animation-name: titleIn;
  animation-duration: 2s;
  animation-timing-function: ease-in-out;
}

/* Grid Format */
/*Formats the text inside the image*/
.container > div {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2em;
  color: #20263f;
}
.container > div > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.container {
  display: grid;
  grid-gap: 40px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  grid-auto-rows: 300px;
}

img {
  border-radius: 10px;
  padding: 5px;
}
.description {
  display: none;
  position: absolute;
}

.container > div:hover {
  transform: scale(1.1);
}
.container > div:hover .description {
  display: block;
  text-align: center;
}

.container > div:hover img {
  opacity: 0.7;
}
/*Footer*/
.footer {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  align-content: flex-start;
}

.footer__tagline-title {
  color: #20263f;
  font-size: 18px;
  font-family: Lora;
}

.footer__tagline {
  font-style: italic;
  color: #c8882d;
}
              
            
!

JS

              
                //You can find all tutorial here :
//https://www.ricardomoreira.io/blog/2020-05-28-create-a-image-gallery
              
            
!
999px

Console