Bootstrap snippet and html example. card chat list

Bootstrap 4.1.1 snippet "card chat list" with HTML, CSS, and JS. Copy, paste, and customize this responsive UI component for your project.
Tags: chat,messages

HTML code

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

<div class="container content">
    <div class="row">
        <div class="col-xl-6 col-lg-6 col-md-6 col-sm-12 col-12">
        	<div class="card">
        		<div class="card-header">Chat</div>
        		<div class="card-body height3">
        			<ul class="chat-list">
        				<li class="in">
        					<div class="chat-img">
        						<img alt="Avtar" src="https://bootdey.com/img/Content/avatar/avatar1.png">
        					</div>
        					<div class="chat-body">
        						<div class="chat-message">
        							<h5>Jimmy Willams</h5>
        							<p>Raw denim heard of them tofu master cleanse</p>
        						</div>
        					</div>
        				</li>
        				<li class="out">
        					<div class="chat-img">
        						<img alt="Avtar" src="https://bootdey.com/img/Content/avatar/avatar6.png">
        					</div>
        					<div class="chat-body">
        						<div class="chat-message">
        							<h5>Serena</h5>
        							<p>Next level veard</p>
        						</div>
        					</div>
        				</li>
        				<li class="in">
        					<div class="chat-img">
        						<img alt="Avtar" src="https://bootdey.com/img/Content/avatar/avatar1.png">
        					</div>
        					<div class="chat-body">
        						<div class="chat-message">
        							<h5 class="name">Jimmy Willams</h5>
        							<p>Will stumptown scenes coffee viral.</p>
        						</div>
        					</div>
        				</li>
        				<li class="out">
        					<div class="chat-img">
        						<img alt="Avtar" src="https://bootdey.com/img/Content/avatar/avatar6.png">
        					</div>
        					<div class="chat-body">
        						<div class="chat-message">
        							<h5>Serena</h5>
        							<p>Tofu master best deal</p>
        						</div>
        					</div>
        				</li>
        			</ul>
        		</div>
        	</div>
        </div>
        <div class="col-xl-6 col-lg-6 col-md-6 col-sm-12 col-12">
        	<div class="card">
        		<div class="card-header">Chat</div>
        		<div class="card-body height3">
        			<ul class="chat-list">
        				<li class="in">
        					<div class="chat-img">
        						<img alt="Avtar" src="https://bootdey.com/img/Content/avatar/avatar2.png">
        					</div>
        					<div class="chat-body">
        						<div class="chat-message">
        							<h5>Jimmy Willams</h5>
        							<p>Raw denim heard of them tofu master cleanse</p>
        						</div>
        					</div>
        				</li>
        				<li class="out">
        					<div class="chat-img">
        						<img alt="Avtar" src="https://bootdey.com/img/Content/avatar/avatar3.png">
        					</div>
        					<div class="chat-body">
        						<div class="chat-message">
        							<h5>Serena</h5>
        							<p>Next level veard</p>
        						</div>
        					</div>
        				</li>
        				<li class="in">
        					<div class="chat-img">
        						<img alt="Avtar" src="https://bootdey.com/img/Content/avatar/avatar2.png">
        					</div>
        					<div class="chat-body">
        						<div class="chat-message">
        							<h5 class="name">Jimmy Willams</h5>
        							<p>Will stumptown scenes coffee viral.</p>
        						</div>
        					</div>
        				</li>
        				<li class="out">
        					<div class="chat-img">
        						<img alt="Avtar" src="https://bootdey.com/img/Content/avatar/avatar3.png">
        					</div>
        					<div class="chat-body">
        						<div class="chat-message">
        							<h5>Serena</h5>
        							<p>Tofu master best deal</p>
        						</div>
        					</div>
        				</li>
        			</ul>
        		</div>
        	</div>
        </div>
    </div>
</div>

CSS code

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

body{
    background:#eee;    
}
.chat-list {
    padding: 0;
    font-size: .8rem;
}

.chat-list li {
    margin-bottom: 10px;
    overflow: auto;
    color: #ffffff;
}

.chat-list .chat-img {
    float: left;
    width: 48px;
}

.chat-list .chat-img img {
    -webkit-border-radius: 50px;
    -moz-border-radius: 50px;
    border-radius: 50px;
    width: 100%;
}

.chat-list .chat-message {
    -webkit-border-radius: 50px;
    -moz-border-radius: 50px;
    border-radius: 50px;
    background: #5a99ee;
    display: inline-block;
    padding: 10px 20px;
    position: relative;
}

.chat-list .chat-message:before {
    content: "";
    position: absolute;
    top: 15px;
    width: 0;
    height: 0;
}

.chat-list .chat-message h5 {
    margin: 0 0 5px 0;
    font-weight: 600;
    line-height: 100%;
    font-size: .9rem;
}

.chat-list .chat-message p {
    line-height: 18px;
    margin: 0;
    padding: 0;
}

.chat-list .chat-body {
    margin-left: 20px;
    float: left;
    width: 70%;
}

.chat-list .in .chat-message:before {
    left: -12px;
    border-bottom: 20px solid transparent;
    border-right: 20px solid #5a99ee;
}

.chat-list .out .chat-img {
    float: right;
}

.chat-list .out .chat-body {
    float: right;
    margin-right: 20px;
    text-align: right;
}

.chat-list .out .chat-message {
    background: #fc6d4c;
}

.chat-list .out .chat-message:before {
    right: -12px;
    border-bottom: 20px solid transparent;
    border-left: 20px solid #fc6d4c;
}

.card .card-header:first-child {
    -webkit-border-radius: 0.3rem 0.3rem 0 0;
    -moz-border-radius: 0.3rem 0.3rem 0 0;
    border-radius: 0.3rem 0.3rem 0 0;
}
.card .card-header {
    background: #17202b;
    border: 0;
    font-size: 1rem;
    padding: .65rem 1rem;
    position: relative;
    font-weight: 600;
    color: #ffffff;
}

.content{
    margin-top:40px;    
}

Similar snippets

Bootstrap example and template. bs4 beta Messages list

bs4 beta Messages list

Bootstrap example and template. Whatsapp web chat template

Whatsapp web chat template

Bootstrap example and template. Clear inbox list

Clear inbox list

Bootstrap example and template. Chat Lobby

Chat Lobby

Bootstrap example and template. media video players

media video players

Bootstrap example and template. summary social networks

summary social networks

Bootstrap example and template. check file manager

check file manager

Bootstrap example and template. Event Schedule list

Event Schedule list

FAQ

How do I use this snippet?

Include Bootstrap 4.1.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.1.1.

Bootstrap example and template. card chat list

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

Bootstrap 4.1.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.1.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