Bootstrap snippet and html example. bs4 beta gallery

Bootstrap 4.0.0-beta snippet "bs4 beta gallery" with HTML, CSS, and JS. Copy, paste, and customize this responsive UI component for your project.
Tags: gallery

HTML code

Clean, semantic HTML that powers this Bootstrap 4.0.0-beta snippet. Copy and paste it into your page (with Bootstrap loaded) to reproduce the exact layout shown in the preview.

<div class="container">

    <div class="row">
        <div class="col-md-3 col-sm-6">
            <a href="#" class="gallery-popup" title="Open Imagination">
                <div class="project-item">
                    <div class="overlay-container">
                        <img src="https://www.bootdey.com/image/350x180/87CEFA/000000" alt="img" class="gallery-thumb-img">
                        <div class="project-item-overlay">
                            <h4>Open Imagination</h4>
                            <p>
                                <img src="https://bootdey.com/img/Content/avatar/avatar1.png" alt="user" class="thumb-sm rounded-circle">
                                <span class="ml-2">Curtis Marion</span>
                            </p>
                        </div>
                    </div>
                </div>
            </a>
        </div>

        <div class="col-md-3 col-sm-6">
            <a href="#" class="gallery-popup" title="Locked Steel Gate">
                <div class="project-item">
                    <div class="overlay-container">
                        <img src="https://www.bootdey.com/image/350x180/008B8B/000000" alt="img" class="gallery-thumb-img">
                        <div class="project-item-overlay">
                            <h4>Locked Steel Gate</h4>
                            <p>
                                <img src="https://bootdey.com/img/Content/avatar/avatar2.png" alt="user" class="thumb-sm rounded-circle">
                                <span class="ml-2">Curtis Marion</span>
                            </p>
                        </div>
                    </div>
                </div>
            </a>
        </div>

        <div class="col-md-3 col-sm-6">
            <a href="#" class="gallery-popup" title="Mac Sunglasses">
                <div class="project-item">
                    <div class="overlay-container">
                        <img src="https://www.bootdey.com/image/350x180/9932CC/000000" alt="img" class="gallery-thumb-img">
                        <div class="project-item-overlay">
                            <h4>Mac Sunglasses</h4>
                            <p>
                                <img src="https://bootdey.com/img/Content/avatar/avatar3.png" alt="user" class="thumb-sm rounded-circle">
                                <span class="ml-2">Curtis Marion</span>
                            </p>
                        </div>
                    </div>
                </div>
            </a>
        </div>

        <div class="col-md-3 col-sm-6">
            <a href="#" class="gallery-popup" title="Morning Dew">
                <div class="project-item">
                    <div class="overlay-container">
                        <img src="https://www.bootdey.com/image/350x180/1E90FF/000000" alt="img" class="gallery-thumb-img">
                        <div class="project-item-overlay">
                            <h4>Morning Dew</h4>
                            <p>
                                <img src="https://bootdey.com/img/Content/avatar/avatar4.png" alt="user" class="thumb-sm rounded-circle">
                                <span class="ml-2">Curtis Marion</span>
                            </p>
                        </div>
                    </div>
                </div>
            </a>
        </div>

        <div class="col-md-3 col-sm-6">
            <a href="#" class="gallery-popup" title="Console Activity">
                <div class="project-item">
                    <div class="overlay-container">
                        <img src="https://www.bootdey.com/image/350x180/FF69B4/000000" alt="img" class="gallery-thumb-img">
                        <div class="project-item-overlay">
                            <h4>Console Activity</h4>
                            <p>
                                <img src="https://bootdey.com/img/Content/avatar/avatar6.png" alt="user" class="thumb-sm rounded-circle">
                                <span class="ml-2">Curtis Marion</span>
                            </p>
                        </div>
                    </div>
                </div>
            </a>
        </div>

        <div class="col-md-3 col-sm-6">
            <a href="#" class="gallery-popup" title="Shake It!">
                <div class="project-item">
                    <div class="overlay-container">
                        <img src="https://www.bootdey.com/image/350x180/87CEFA/000000" alt="img" class="gallery-thumb-img">
                        <div class="project-item-overlay">
                            <h4>Shake It!</h4>
                            <p>
                                <img src="https://bootdey.com/img/Content/avatar/avatar1.png" alt="user" class="thumb-sm rounded-circle">
                                <span class="ml-2">Curtis Marion</span>
                            </p>
                        </div>
                    </div>
                </div>
            </a>
        </div>

        <div class="col-md-3 col-sm-6">
            <a href="#" class="gallery-popup" title="Backpack Content">
                <div class="project-item">
                    <div class="overlay-container">
                        <img src="https://www.bootdey.com/image/350x180/D3D3D3/000000" alt="img" class="gallery-thumb-img">
                        <div class="project-item-overlay">
                            <h4>Backpack Content</h4>
                            <p>
                                <img src="https://bootdey.com/img/Content/avatar/avatar2.png" alt="user" class="thumb-sm rounded-circle">
                                <span class="ml-2">Curtis Marion</span>
                            </p>
                        </div>
                    </div>
                </div>
            </a>
        </div>

        <div class="col-md-3 col-sm-6">
            <a href="#" class="gallery-popup" title="Sunset Bulb Glow">
                <div class="project-item">
                    <div class="overlay-container">
                        <img src="https://www.bootdey.com/image/350x180/90EE90/000000" alt="img" class="gallery-thumb-img">
                        <div class="project-item-overlay">
                            <h4>Sunset Bulb Glow</h4>
                            <p>
                                <img src="https://bootdey.com/img/Content/avatar/avatar3.png" alt="user" class="thumb-sm rounded-circle">
                                <span class="ml-2">Curtis Marion</span>
                            </p>
                        </div>
                    </div>
                </div>
            </a>
        </div>

        <div class="col-md-3 col-sm-6">
            <a href="#" class="gallery-popup" title="Open Imagination">
                <div class="project-item">
                    <div class="overlay-container">
                        <img src="https://www.bootdey.com/image/350x180/87CEFA/000000" alt="img" class="gallery-thumb-img">
                        <div class="project-item-overlay">
                            <h4>Open Imagination</h4>
                            <p>
                                <img src="https://bootdey.com/img/Content/avatar/avatar1.png" alt="user" class="thumb-sm rounded-circle">
                                <span class="ml-2">Curtis Marion</span>
                            </p>
                        </div>
                    </div>
                </div>
            </a>
        </div>

        <div class="col-md-3 col-sm-6">
            <a href="#" class="gallery-popup" title="Console Activity">
                <div class="project-item">
                    <div class="overlay-container">
                        <img src="https://www.bootdey.com/image/350x180/20B2AA/000000" alt="img" class="gallery-thumb-img">
                        <div class="project-item-overlay">
                            <h4>Console Activity</h4>
                            <p>
                                <img src="https://bootdey.com/img/Content/avatar/avatar6.png" alt="user" class="thumb-sm rounded-circle">
                                <span class="ml-2">Curtis Marion</span>
                            </p>
                        </div>
                    </div>
                </div>
            </a>
        </div>

        <div class="col-md-3 col-sm-6">
            <a href="#" class="gallery-popup" title="Open Imagination">
                <div class="project-item">
                    <div class="overlay-container">
                        <img src="https://www.bootdey.com/image/350x180/87CEFA/000000" alt="img" class="gallery-thumb-img">
                        <div class="project-item-overlay">
                            <h4>Open Imagination</h4>
                            <p>
                                <img src="https://bootdey.com/img/Content/avatar/avatar1.png" alt="user" class="thumb-sm rounded-circle">
                                <span class="ml-2">Curtis Marion</span>
                            </p>
                        </div>
                    </div>
                </div>
            </a>
        </div>

        <div class="col-md-3 col-sm-6">
            <a href="#" class="gallery-popup" title="Shake It!">
                <div class="project-item">
                    <div class="overlay-container">
                        <img src="https://www.bootdey.com/image/350x180/B0C4DE/000000" alt="img" class="gallery-thumb-img">
                        <div class="project-item-overlay">
                            <h4>Shake It!</h4>
                            <p>
                                <img src="https://bootdey.com/img/Content/avatar/avatar6.png" alt="user" class="thumb-sm rounded-circle">
                                <span class="ml-2">Curtis Marion</span>
                            </p>
                        </div>
                    </div>
                </div>
            </a>
        </div>

    </div>
</div>

CSS code

Scoped CSS that styles the component. Paste it after Bootstrap 4.0.0-beta to keep the design, spacing, and responsiveness consistent.

body{margin-top:20px;background:#FCFCFC}
/* =============
   Gallery
============= */

.overlay-container {
    position: relative;
}

.project-item img.gallery-thumb-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 10px;
    margin-top: 10px;
}

.project-item-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    width: 100%;
    opacity: 0;
    border-radius: 5px;
    background: -moz-linear-gradient(top, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.8) 100%);
    /* FF3.6-15 */
    background: -webkit-linear-gradient(top, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.8) 100%);
    /* Chrome10-25,Safari5.1-6 */
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.8) 100%);
    /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
    transition: .5s ease;
}

.project-item-overlay h4 {
    font-size: 18px;
    font-weight: 500;
    white-space: nowrap;
    color: white;
    position: absolute;
    overflow: hidden;
    top: 7%;
    left: 7%;
    margin: 0;
    text-overflow: ellipsis;
}

.project-item-overlay p {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    color: white;
    position: absolute;
    overflow: hidden;
    bottom: 7%;
    left: 7%;
    text-overflow: ellipsis;
    margin: 0;
}

.overlay-container:hover .project-item-overlay {
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    opacity: 1;
    height: 100%;
    width: 100%;
    transition: .5s ease;
}

.thumb-sm {
    height: 32px;
    width: 32px;
}

.rounded-circle {
    border-radius: 50%;
}

Similar snippets

Bootstrap example and template. Bootstrap Gallery with Modal Lightbox and Carousel

Bootstrap Gallery with Modal Lightbox and Carousel

Bootstrap example and template. Gallery of images

Gallery of images

Bootstrap example and template. gallery small images with hover

gallery small images with hover

Bootstrap example and template. Image gallery with effects

Image gallery with effects

Bootstrap example and template. Complete User Profile Page for Bootstrap

Complete User Profile Page for Bootstrap

Bootstrap example and template. team members with left social icons

team members with left social icons

Bootstrap example and template. Bootstrap colored Nav with nice alerts

Bootstrap colored Nav with nice alerts

Bootstrap example and template. user presentation profile with description

user presentation profile with description

FAQ

How do I use this snippet?

Include Bootstrap 4.0.0-beta, paste the HTML, add the CSS block, and include the JS (if any) to mirror the live preview.

Can I use it in commercial projects?

Yes. It’s free for personal and commercial work; check the snippets license for details.

Is it responsive?

Yes. It inherits the responsive grid and components from Bootstrap 4.0.0-beta.

Bootstrap example and template. bs4 beta gallery

About this bootstrap example/template

Optimized for copy‑paste: clean HTML, scoped CSS, and minimal JS so you can ship production‑ready UI faster and keep designs consistent.

Mobile‑first and responsive by default. Tested across modern browsers to reduce polish time on your project.

Already trusted in 7.8K+ views. Reuse this snippet to speed up landing pages, dashboards, or onboarding flows.

Bootstrap 4.0.0-beta

<link rel='stylesheet' href='https://netdna.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css'>

<script src='https://netdna.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js'></script>

This code example is based on bootstrap 4.0.0-beta and the grid system of this framework

Responsive

Based on bootstrap framework makes all the layouts perfectly responsive for all devices

Crossbrowser compatibility

Tested on all major browsers, it works smoothly on all of them

semantic html 5

Built on html / css3 the code quality is really amazing

Simple Integration

This code example can be simply integrated on existing sites and new ones too, all you need to do is copy the code and start working