Bootstrap snippet and html example. modal post

Bootstrap 4.3.1 snippet "modal post" with HTML, CSS, and JS. Copy, paste, and customize this responsive UI component for your project.
Tags: post

HTML code

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

<section class="single-post">
  <div class="container-fluid">
   <div class="row">
 
  <div class="modal-dialog">
   <div class="modal-content">
    <div class="modal-body">
    
     <div class="row">
	 
      <div class="col-md-8 modal-image">
       <img class="img-responsive" src="http://themashabrand.com/templates/Fluffs/assets/img/posts/15.jpg" alt="Image">
      </div><!--/ col-md-8 -->
      <div class="col-md-4 modal-meta">
       <div class="modal-meta-top">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
		 <span aria-hidden="true">×</span><span class="sr-only">Close</span>
		</button><!--/ button -->
        <div class="img-poster clearfix">
         <a href=""><img class="img-responsive img-circle" src="http://themashabrand.com/templates/Fluffs/assets/img/users/18.jpg" alt="Image"></a>
         <strong><a href="">Benjamin</a></strong>
         <span>12 minutes ago</span><br>
	     <a href="" class="kafe kafe-btn-mint-small"><i class="fa fa-check-square"></i> Following</a>
        </div><!--/ img-poster -->
		  
        <ul class="img-comment-list">
         <li>
          <div class="comment-img">
           <img src="http://themashabrand.com/templates/Fluffs/assets/img/users/17.jpeg" class="img-responsive img-circle" alt="Image">
          </div>
          <div class="comment-text">
           <strong><a href="">Anthony McCartney</a></strong>
           <p>Hello this is a test comment.</p> <span class="date sub-text">on December 5th, 2016</span>
          </div>
         </li><!--/ li -->
         <li>
          <div class="comment-img">
           <img src="http://themashabrand.com/templates/Fluffs/assets/img/users/15.jpg" class="img-responsive img-circle" alt="Image">
          </div>
          <div class="comment-text">
           <strong><a href="">Vanessa Wells</a></strong>
           <p>Hello this is a test comment and this comment is particularly very long and it goes on and on and on.</p> <span>on December 5th, 2016</span>
          </div>
         </li><!--/ li -->
         <li>
          <div class="comment-img">
           <img src="http://themashabrand.com/templates/Fluffs/assets/img/users/14.jpg" class="img-responsive img-circle" alt="Image">
          </div>
          <div class="comment-text">
           <strong><a href="">Sean Coleman</a></strong>
           <p class="">Hello this is a test comment.</p> <span class="date sub-text">on December 5th, 2016</span>
          </div>
         </li><!--/ li -->
         <li>
          <div class="comment-img">
           <img src="http://themashabrand.com/templates/Fluffs/assets/img/users/13.jpeg" class="img-responsive img-circle" alt="Image">
          </div>
          <div class="comment-text">
           <strong><a href="">Anna Morgan</a></strong>
           <p class="">Hello this is a test comment.</p> <span class="date sub-text">on December 5th, 2016</span>
          </div>
         </li><!--/ li -->
         <li>
          <div class="comment-img">
           <img src="http://themashabrand.com/templates/Fluffs/assets/img/users/3.jpg" class="img-responsive img-circle" alt="Image">
          </div>
          <div class="comment-text">
           <strong><a href="">Allison Fowler</a></strong>
           <p class="">Hello this is a test comment.</p> <span class="date sub-text">on December 5th, 2016</span>
          </div>
         </li><!--/ li -->
        </ul><!--/ comment-list -->
		  
        <div class="modal-meta-bottom">
		 <ul>
		  <li><a class="modal-like" href="#"><i class="fa fa-heart"></i></a><span class="modal-one"> 786,286</span> | 
		      <a class="modal-comment" href="#"><i class="fa fa-comments"></i></a><span> 786,286</span> </li>
		  <li>
		   <span class="thumb-xs">
			<img class="img-responsive img-circle" src="http://themashabrand.com/templates/Fluffs/assets/img/users/13.jpeg" alt="Image">
		   </span>
		   <div class="comment-body">
			 <input class="form-control input-sm" type="text" placeholder="Write your comment...">
		   </div><!--/ comment-body -->	
          </li>				
         </ul>				
        </div><!--/ modal-meta-bottom -->
		  
       </div><!--/ modal-meta-top -->
      </div><!--/ col-md-4 -->
	  
     </div><!--/ row -->
    </div><!--/ modal-body -->
	
   </div><!--/ modal-content -->
  </div><!--/ modal-dialog -->
  
  </div><!--/ modal-dialog -->
  </div><!--/ modal-dialog -->
 </section>

CSS code

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

body{margin-top:20px;}
.single-post{
  background: #f4f4f4;    
  padding: 80px 0px 150px 0px;
}
.modal-dialog{
  width: 830px;    
  height: 450px !important;
}
.modal-image img{
  width: 600px !important;	
  height: 540px !important;	
}

.img-poster{
  margin-bottom: 10px;	
  border-bottom: solid 1px #f4f4f4;
  padding-bottom: 5px;	
}
.modal-meta-top .img-poster img {
  height: 34px;
  width: 34px;
  float: left !important;
  margin-right: 10px;
  border: 4px solid #f4f4f4;
}
.modal-meta-top .img-poster a{
  font-family: 'Abhaya Libre', serif;	
  font-size: 14px;	
  color: #88898a !important;	
}
.modal-meta-top .img-poster span {
  font-family: 'Abhaya Libre', serif;
  color: #aaa;
  font-size: 12px;
}
.modal-meta-top .img-poster a.kafe-btn-mint-small {
  font-family: 'Abhaya Libre', serif; 	
  margin-left: 0px;
  color: #fff !important;
  border-radius: 3px;  
}


.img-comment-list {
  list-style: none;  
  padding: 0px 10px 30px 0px;
  height: 390px !important;
  overflow-y: scroll;	
}
.img-comment-list li {
    margin-top: 5px 0px 10px 0px;
}
.img-comment-list li > div {
    display:table-cell;
}
.img-comment-list .comment-img {
  float: left !important;	
  margin-right: 10px !important;
  margin-top: 5px;
}
.img-comment-list img {
  width: 22px;
  height: 22px;
}
.img-comment-list li a{
  font-family: 'Abhaya Libre', serif;	
  font-size: 14px;	
  color: #88898a !important;	
}
.img-comment-list p {
  font-family: 'Abhaya Libre', serif;
  margin: 0;
  font-size: 13px;
  color: #848484;
}
.img-comment-list span {
  font-family: 'Abhaya Libre', serif;
  font-size: .8em; 
  color: #aaa;
}


.modal-meta-bottom {
    bottom: 0;
    left: 0;
    right: 0;
    padding: 5px;
    border-top: solid 1px #f4f4f4;
	display: block;
}
.modal-meta-bottom ul{
  margin: 0px !important;
  padding: 0px !important;
  font-size: 0px !important;
}
.modal-meta-bottom li{
  list-style: none;	
  padding: 0px !important;
  margin: 0px !important;
  font-size: 0px !important;
}
.modal-meta-bottom li a.modal-like i{
  font-size: 14px !important;
  color: #e16a70 !important;
  margin-right: 4px;
  margin-left: 10px;
}
.modal-meta-bottom li a.modal-comment i{
  font-size: 14px !important;
  color: #848484 !important;
  margin-right: 4px;
}
.modal-meta-bottom li span.modal-one{
  margin-right: 10px;	
  color: #e16a70 !important;
}
.modal-meta-bottom li span{
  font-family: 'Abhaya Libre', serif;	
  font-size: 14px !important;
  color: #848484;
}
.modal-meta-bottom li a:hover{
  color: #e16a70 !important;
}
.modal-meta-bottom .thumb-xs{
  display: inline-block;
  text-align: center;
  margin: 0px !important;
  padding: 0px !important;
}
.modal-meta-bottom .thumb-xs img{
  width: 25px;
  height: 25px;  
}
.modal-meta-bottom .comment-body {
  float: right !important;
  margin: 0px !important;
  padding: 0px !important;
}
.modal-meta-bottom .comment-body input{
  width: 200px !important;
}


/* ==========================================================================
   Media Queries for Modal
   ========================================================================== */
   
/* Desktop */
@media (max-width: 1024px){
}

@media (max-width: 992px){
	.modal-dialog{
	  width: 700px;	
	}	
    .modal-content {
        border-radius: 0;
        max-height: 100%;
        overflow-y: auto;
    }
	.img-poster{
	  padding-top: 5px;	
	}	
}


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

.modal-image img {
    width: 600px !important;
    height: 540px !important;
}

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

FAQ

How do I use this snippet?

Include Bootstrap 4.3.1, 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.3.1.

Bootstrap example and template. modal post

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

Bootstrap 4.3.1

<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.3.1 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