Bootstrap snippet and html example. box gallery

This html snippet was created to help web designers, web developers, front-end and back-end developer save time. Use it for free in your project and build your app faster, You can also download the HTML, CSS, and JS code.
Tags: gallery

HTML code

This is the html code used to create this bootstrap snippet, You can copy and paste the following html code inside a page with bootstrap 4.5.0 included, to get the result that you can see in the preview selection

<script src="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.9.0/baguetteBox.min.js" integrity="sha512-+8LoWbC6Y9Vy85wapJUYlRvabpzAIGhgiL6vZWNHn0F8EFJ43a1BCSzXo7b7OeY6bczJ3Q+ifRweZpW1iPAARg==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.2.0/highlight.min.js" integrity="sha512-TDKKr+IvoqZnPzc3l35hdjpHD0m+b2EC2SrLEgKDRWpxf2rFCxemkgvJ5kfU48ip+Y+m2XVKyOCD85ybtlZDmw==" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.9.0/baguetteBox.min.css" integrity="sha512-tbjZFdjHyHckTfeqkgVFcQ3GJWVfdsNYFvl+rEWmofjj9JpWaohlZgq0Vb6Hav5rqIL019LFpLsE+sTNSfNVXA==" crossorigin="anonymous" />

<div class="container">
<div class="baguetteBoxThree gallery">
	<!-- Row start -->
	<div class="row gutters">							
		<div class="col-xl-3 col-lg-4 col-md-6 col-sm-6 col-12">
			<a href="https://www.bootdey.com/image/350x350/87CEFA/000000" class="effects">
				<img src="https://www.bootdey.com/image/350x350/87CEFA/000000" class="img-fluid" alt="Maxwell Admin">
				<div class="overlay">
					<span class="expand">+</span>
				</div>
			</a>
		</div>
		<div class="col-xl-3 col-lg-4 col-md-6 col-sm-6 col-12">
			<a href="https://www.bootdey.com/image/350x350/87CEFA/000000" class="effects">
				<img src="https://www.bootdey.com/image/350x350/87CEFA/000000" class="img-fluid" alt="Maxwell Admin">
				<div class="overlay">
					<span class="expand">+</span>
				</div>
			</a>
		</div>
		<div class="col-xl-3 col-lg-4 col-md-6 col-sm-6 col-12">
			<a href="https://www.bootdey.com/image/350x350/87CEFA/000000" class="effects">
				<img src="https://www.bootdey.com/image/350x350/87CEFA/000000" class="img-fluid" alt="Maxwell Admin">
				<div class="overlay">
					<span class="expand">+</span>
				</div>
			</a>
		</div>
		<div class="col-xl-3 col-lg-4 col-md-6 col-sm-6 col-12">
			<a href="https://www.bootdey.com/image/350x350/87CEFA/000000" class="effects">
				<img src="https://www.bootdey.com/image/350x350/87CEFA/000000" class="img-fluid" alt="Maxwell Admin">
				<div class="overlay">
					<span class="expand">+</span>
				</div>
			</a>
		</div>							
		<div class="col-xl-3 col-lg-4 col-md-6 col-sm-6 col-12">
			<a href="https://www.bootdey.com/image/350x350/87CEFA/000000" class="effects">
				<img src="https://www.bootdey.com/image/350x350/87CEFA/000000" class="img-fluid" alt="Maxwell Admin">
				<div class="overlay">
					<span class="expand">+</span>
				</div>
			</a>
		</div>
		<div class="col-xl-3 col-lg-4 col-md-6 col-sm-6 col-12">
			<a href="https://www.bootdey.com/image/350x350/87CEFA/000000" class="effects">
				<img src="https://www.bootdey.com/image/350x350/87CEFA/000000" class="img-fluid" alt="Maxwell Admin">
				<div class="overlay">
					<span class="expand">+</span>
				</div>
			</a>
		</div>
		<div class="col-xl-3 col-lg-4 col-md-6 col-sm-6 col-12">
			<a href="https://www.bootdey.com/image/350x350/87CEFA/000000" class="effects">
				<img src="https://www.bootdey.com/image/350x350/87CEFA/000000" class="img-fluid" alt="Maxwell Admin">
				<div class="overlay">
					<span class="expand">+</span>
				</div>
			</a>
		</div>							
		<div class="col-xl-3 col-lg-4 col-md-6 col-sm-6 col-12">
			<a href="https://www.bootdey.com/image/350x350/87CEFA/000000" class="effects">
				<img src="https://www.bootdey.com/image/350x350/87CEFA/000000" class="img-fluid" alt="Maxwell Admin">
				<div class="overlay">
					<span class="expand">+</span>
				</div>
			</a>
		</div>
		<div class="col-xl-3 col-lg-4 col-md-6 col-sm-6 col-12">
			<a href="https://www.bootdey.com/image/350x350/87CEFA/000000" class="effects">
				<img src="https://www.bootdey.com/image/350x350/87CEFA/000000" class="img-fluid" alt="Maxwell Admin">
				<div class="overlay">
					<span class="expand">+</span>
				</div>
			</a>
		</div>							
		<div class="col-xl-3 col-lg-4 col-md-6 col-sm-6 col-12">
			<a href="https://www.bootdey.com/image/350x350/87CEFA/000000" class="effects">
				<img src="https://www.bootdey.com/image/350x350/87CEFA/000000" class="img-fluid" alt="Maxwell Admin">
				<div class="overlay">
					<span class="expand">+</span>
				</div>
			</a>
		</div>
		<div class="col-xl-3 col-lg-4 col-md-6 col-sm-6 col-12">
			<a href="https://www.bootdey.com/image/350x350/87CEFA/000000" class="effects">
				<img src="https://www.bootdey.com/image/350x350/87CEFA/000000" class="img-fluid" alt="Maxwell Admin">
				<div class="overlay">
					<span class="expand">+</span>
				</div>
			</a>
		</div>
		<div class="col-xl-3 col-lg-4 col-md-6 col-sm-6 col-12">
			<a href="https://www.bootdey.com/image/350x350/87CEFA/000000" class="effects">
				<img src="https://www.bootdey.com/image/350x350/87CEFA/000000" class="img-fluid" alt="Maxwell Admin">
				<div class="overlay">
					<span class="expand">+</span>
				</div>
			</a>
		</div>
		<div class="col-xl-3 col-lg-4 col-md-6 col-sm-6 col-12">
			<a href="https://www.bootdey.com/image/350x350/87CEFA/000000" class="effects">
				<img src="https://www.bootdey.com/image/350x350/87CEFA/000000" class="img-fluid" alt="Maxwell Admin">
				<div class="overlay">
					<span class="expand">+</span>
				</div>
			</a>
		</div>
		<div class="col-xl-3 col-lg-4 col-md-6 col-sm-6 col-12">
			<a href="https://www.bootdey.com/image/350x350/87CEFA/000000" class="effects">
				<img src="https://www.bootdey.com/image/350x350/87CEFA/000000" class="img-fluid" alt="Maxwell Admin">
				<div class="overlay">
					<span class="expand">+</span>
				</div>
			</a>
		</div>
		<div class="col-xl-3 col-lg-4 col-md-6 col-sm-6 col-12">
			<a href="https://www.bootdey.com/image/350x350/87CEFA/000000" class="effects">
				<img src="https://www.bootdey.com/image/350x350/87CEFA/000000" class="img-fluid" alt="Maxwell Admin">
				<div class="overlay">
					<span class="expand">+</span>
				</div>
			</a>
		</div>
		<div class="col-xl-3 col-lg-4 col-md-6 col-sm-6 col-12">
			<a href="https://www.bootdey.com/image/350x350/87CEFA/000000" class="effects">
				<img src="https://www.bootdey.com/image/350x350/87CEFA/000000" class="img-fluid" alt="Maxwell Admin">
				<div class="overlay">
					<span class="expand">+</span>
				</div>
			</a>
		</div>
	</div>
	<!-- Row end -->
</div>
</div>

CSS code

This is the css code used to create this bootstrap snippet, You can copy and paste the following css code inside a page with bootstrap 4.5.0 included, to get the result that you can see in the preview selection

body{margin-top:20px;}
.gallery {
    margin: 0 auto;
}
.gallery a {
    position: relative;
    overflow: hidden;
    -webkit-transition: all 0.3s ease-out;
    -moz-transition: all 0.3s ease-out;
    -ms-transition: all 0.3s ease-out;
    -o-transition: all 0.3s ease-out;
    transition: all 0.3s ease-out;
    display: block;
    margin: 0 0 15px 0;
    opacity: 1;
}
.gallery a img {
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
}
.gallery a .overlay {
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    opacity: 0;
    position: absolute;
    z-index: 20;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
    background: linear-gradient(120deg, rgba(42, 76, 245, 0.4) 0%, rgba(0, 158, 253, 0.2) 100%);
    overflow: hidden;
    -webkit-transition: all 0.5s ease-out;
    -moz-transition: all 0.5s ease-out;
    -ms-transition: all 0.5s ease-out;
    -o-transition: all 0.5s ease-out;
    transition: all 0.5s ease-out;
}
.gallery a .expand {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 100;
    border: 2px solid #000000;
    text-align: center;
    color: #000000;
    line-height: 32px;
    -webkit-border-radius: 30px;
    -moz-border-radius: 30px;
    border-radius: 30px;
    font-size: 20px;
    margin-left: -18px;
    margin-top: -18px;
    width: 36px;
    height: 36px;
    -webkit-transition: all 0.5s ease-out;
    -moz-transition: all 0.5s ease-out;
    -ms-transition: all 0.5s ease-out;
    -o-transition: all 0.5s ease-out;
    transition: all 0.5s ease-out;
}
.gallery a:hover {
    opacity: 1;
}
.gallery a:hover .overlay {
    opacity: 1;
}
.gallery a:hover span.expand {
    width: 36px;
    height: 36px;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
}

.photo-gallery img {
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
    margin: 0 0 0.8rem 0;
}

Javascript/Jquery code

This is the javascript code used to create this bootstrap snippet, You can copy and paste the following javascript code inside a page with bootstrap 4.5.0 included, to get the result that you can see in the preview selection

window.onload = function() {
    if(typeof oldIE === 'undefined' && Object.keys)
	hljs.initHighlighting();
	baguetteBox.run('.baguetteBoxOne');
	baguetteBox.run('.baguetteBoxTwo');
	baguetteBox.run('.baguetteBoxThree', {
		animation: 'fadeIn',
	});
	baguetteBox.run('.baguetteBoxFour', {
		buttons: false
	});
	baguetteBox.run('.baguetteBoxFive');
}; 

Similar snippets

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

Bootstrap Gallery with Modal Lightbox and Carousel

Bootstrap example and template. Image gallery with effects

Image gallery with effects

Bootstrap example and template. profile gallery with search input

profile gallery with search input

Bootstrap example and template. bs4 beta gallery

bs4 beta gallery

Bootstrap example and template. bs5 dark footer

bs5 dark footer

Bootstrap example and template. bs4 simple read email

bs4 simple read email

Bootstrap example and template. blue login

blue login

Bootstrap example and template. bs4 inbox list

bs4 inbox list

Bootstrap example and template. box gallery

About this bootstrap example/template

We hope you will enjoy this awesome snippet and stay tuned for the latest updates, bootdey snippets are already used in thousands of blogs, websites and projects. We believe it will save your precious time and gives trendy look to your next web project.

We always try to offer the best beautiful and responsive source of Bootstrap code examples and components.

This code example currectly have 302 views, Using this bootstrap snippet you have the following benefits:

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

Jquery plugins

Great built-in plugins with jquery framework, you can easy to change all declarations

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