Bootstrap snippet and html example. image post gallery like facebook

Bootstrap 4.5.0 snippet "image post gallery like facebook" 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.5.0 snippet. Copy and paste it into your page (with Bootstrap loaded) to reproduce the exact layout shown in the preview.

<div class="container profile mb-4">
    <div class="profile-img-list">
        <div class="profile-img-list-item main"><a href="#" class="profile-img-list-link"><span class="profile-img-content" style="background-image: url(https://www.bootdey.com/image/350x280/6495ED/000000)"></span></a></div>
        <div class="profile-img-list-item main"><a href="#" class="profile-img-list-link"><span class="profile-img-content" style="background-image: url(https://www.bootdey.com/image/350x280/5F9EA0/000000)"></span></a></div>
        <div class="profile-img-list-item"><a href="#" class="profile-img-list-link"><span class="profile-img-content" style="background-image: url(https://www.bootdey.com/image/350x280/FF7F50/000000)"></span></a></div>
        <div class="profile-img-list-item"><a href="#" class="profile-img-list-link"><span class="profile-img-content" style="background-image: url(https://www.bootdey.com/image/350x280/DC143C/000000)"></span></a></div>
        <div class="profile-img-list-item"><a href="#" class="profile-img-list-link"><span class="profile-img-content" style="background-image: url(https://www.bootdey.com/image/350x280/FFB6C1/000000)"></span></a></div>
        <div class="profile-img-list-item"><a href="#" class="profile-img-list-link"><span class="profile-img-content" style="background-image: url(https://www.bootdey.com/image/350x280/00008B/000000)"></span></a></div>
    </div>
</div>
<br>
<div class="container profile">
    <div class="profile-img-list">
		<div class="profile-img-list-item main"><a href="#" class="profile-img-list-link"><span class="profile-img-content" style="background-image: url(https://www.bootdey.com/image/350x280/FFB6C1/000000)"></span></a></div>
		<div class="profile-img-list-item"><a href="#" class="profile-img-list-link"><span class="profile-img-content" style="background-image: url(https://www.bootdey.com/image/350x280/9932CC/000000)"></span></a></div>
		<div class="profile-img-list-item"><a href="#" class="profile-img-list-link"><span class="profile-img-content" style="background-image: url(https://www.bootdey.com/image/350x280/00CED1/000000)"></span></a></div>
		<div class="profile-img-list-item"><a href="#" class="profile-img-list-link"><span class="profile-img-content" style="background-image: url(https://www.bootdey.com/image/350x280/1E90FF/000000)"></span></a></div>
		<div class="profile-img-list-item with-number">
			<a href="#" class="profile-img-list-link">
				<span class="profile-img-content" style="background-image: url(https://www.bootdey.com/image/350x280/1E90FF/000000)"></span>
				<div class="profile-img-number">+12</div>
			</a>
		</div>
	</div>
</div>

CSS code

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


.profile {
margin-top:20px;
margin-bottom:60px;
}
.profile .profile-img-list {
    list-style-type: none;
    margin: -0.0625rem -1.3125rem;
    padding: 0;
}
.profile .profile-img-list:after,
.profile .profile-img-list:before {
    content: "";
    display: table;
    clear: both;
}
.profile .profile-img-list .profile-img-list-item {
    float: left;
    width: 25%;
    padding: 0.0625rem;
}
.profile .profile-img-list .profile-img-list-item.main {
    width: 50%;
}
.profile .profile-img-list .profile-img-list-item .profile-img-list-link {
    display: block;
    padding-top: 75%;
    overflow: hidden;
    position: relative;
}
.profile .profile-img-list .profile-img-list-item .profile-img-list-link .profile-img-content,
.profile .profile-img-list .profile-img-list-item .profile-img-list-link img {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.profile .profile-img-list .profile-img-list-item .profile-img-list-link .profile-img-content:before,
.profile .profile-img-list .profile-img-list-item .profile-img-list-link img:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(60, 78, 113, 0.15);
}
.profile .profile-img-list .profile-img-list-item.with-number .profile-img-number {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    color: #fff;
    font-size: 1.625rem;
    font-weight: 500;
    line-height: 1.625rem;
    margin-top: -0.8125rem;
    text-align: center;
}

Similar snippets

Bootstrap example and template. User Profile with tabs

User Profile with tabs

Bootstrap example and template. gallery images profile

gallery images profile

Bootstrap example and template. gallery with small images

gallery with small images

Bootstrap example and template. gallery small images with hover

gallery small images with hover

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. profile projects

profile projects

Bootstrap example and template. file managaer page

file managaer page

FAQ

How do I use this snippet?

Include Bootstrap 4.5.0, 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.5.0.

Bootstrap example and template. image post gallery like facebook

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 10.1K+ views. Reuse this snippet to speed up landing pages, dashboards, or onboarding flows.

Bootstrap 4.5.0

<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css'>

<script src='https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js'></script>

This code example is based on bootstrap 4.5.0 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