Bootstrap snippet and html example. bs4 chat with gradient bg

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: bs4,chat,gradient,messages

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.1.1 included, to get the result that you can see in the preview selection

<div class="container">
<div class="row">
                                <!-- [ message ] start -->
                                <div class="col-sm-12">
                                    <div class="card msg-card mb-0">
                                        <div class="card-body msg-block">
                                            <div class="row">
                                                <div class="col-lg-3 col-md-12">
                                                    <div class="message-mobile">
                                                        <div class="task-right-header-status">
                                                            <span class="f-w-400" data-toggle="collapse">Friend List</span>
                                                            <i class="fas fa-times float-right m-t-10"></i>
                                                        </div>
                                                        <div class="taskboard-right-progress">
                                                            <div class="h-list-header">
                                                                <div class="input-group">
                                                                    <input type="text" id="msg-friends" class="form-control" placeholder="Search Friend . . .">
                                                                    <div class="input-group-append">
                                                                        <span class="input-group-text"><i class="feather icon-search"></i></span>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="h-list-body">
                                                                <div class="msg-user-list scroll-div ps ps--active-y">
                                                                    <div class="main-friend-list">
                                                                        <div class="media userlist-box " data-id="1" data-status="online" data-username="Josephin Doe">
                                                                            <a class="media-left" href="javascript:"><img class="media-object img-radius" src="../assets/images/user/avatar-1.jpg" alt="Generic placeholder image ">
                                                                                <div class="live-status">3</div>
                                                                            </a>
                                                                            <div class="media-body">
                                                                                <h6 class="chat-header">Josephin Doe<small class="d-block text-c-green">Typing . . </small></h6>
                                                                            </div>
                                                                        </div>
                                                                        <div class="media userlist-box active " data-id="2" data-status="online" data-username="Lary Doe">
                                                                            <a class="media-left" href="javascript:"><img class="media-object img-radius" src="../assets/images/user/avatar-2.jpg" alt="Generic placeholder image">
                                                                                <div class="live-status">1</div>
                                                                            </a>
                                                                            <div class="media-body">
                                                                                <h6 class="chat-header">Lary Doe<small class="d-block text-c-green">online</small></h6>
                                                                            </div>
                                                                        </div>
                                                                        <div class="media userlist-box " data-id="3" data-status="online" data-username="Alice">
                                                                            <a class="media-left" href="javascript:"><img class="media-object img-radius" src="../assets/images/user/avatar-3.jpg" alt="Generic placeholder image"></a>
                                                                            <div class="media-body">
                                                                                <h6 class="chat-header">Alice<small class="d-block text-c-green">online</small></h6>
                                                                            </div>
                                                                        </div>
                                                                        <div class="media userlist-box " data-id="4" data-status="offline" data-username="Alia">
                                                                            <a class="media-left" href="javascript:"><img class="media-object img-radius" src="../assets/images/user/avatar-1.jpg" alt="Generic placeholder image">
                                                                                <div class="live-status">1</div>
                                                                            </a>
                                                                            <div class="media-body">
                                                                                <h6 class="chat-header">Alia<small class="d-block text-muted">10 min ago</small></h6>
                                                                            </div>
                                                                        </div>
                                                                        <div class="media userlist-box " data-id="5" data-status="offline" data-username="Suzen">
                                                                            <a class="media-left" href="javascript:"><img class="media-object img-radius" src="../assets/images/user/avatar-4.jpg" alt="Generic placeholder image"></a>
                                                                            <div class="media-body">
                                                                                <h6 class="chat-header">Suzen<small class="d-block text-muted">15 min ago</small></h6>
                                                                            </div>
                                                                        </div>
                                                                        <div class="media userlist-box " data-id="1" data-status="online" data-username="Josephin Doe">
                                                                            <a class="media-left" href="javascript:"><img class="media-object img-radius" src="../assets/images/user/avatar-1.jpg" alt="Generic placeholder image "></a>
                                                                            <div class="media-body">
                                                                                <h6 class="chat-header">Josephin Doe<small class="d-block text-muted">10 min ago</small></h6>
                                                                            </div>
                                                                        </div>
                                                                        <div class="media userlist-box " data-id="2" data-status="online" data-username="Lary Doe">
                                                                            <a class="media-left" href="javascript:"><img class="media-object img-radius" src="../assets/images/user/avatar-2.jpg" alt="Generic placeholder image"></a>
                                                                            <div class="media-body">
                                                                                <h6 class="chat-header">Lary Doe<small class="d-block text-c-green">online</small></h6>
                                                                            </div>
                                                                        </div>
                                                                        <div class="media userlist-box " data-id="3" data-status="online" data-username="Alice">
                                                                            <a class="media-left" href="javascript:"><img class="media-object img-radius" src="../assets/images/user/avatar-3.jpg" alt="Generic placeholder image"></a>
                                                                            <div class="media-body">
                                                                                <h6 class="chat-header">Alice<small class="d-block text-c-green">online</small></h6>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                <div class="ps__rail-x" style="left: 0px; bottom: 0px;"><div class="ps__thumb-x" tabindex="0" style="left: 0px; width: 0px;"></div></div><div class="ps__rail-y" style="top: 0px; height: 114px; right: 0px;"><div class="ps__thumb-y" tabindex="0" style="top: 0px; height: 40px;"></div></div></div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="col-lg-9 col-md-12">
                                                    <div class="ch-block">
                                                        <div class="h-list-body">
                                                            <div class="msg-user-chat scroll-div ps ps--active-y">
                                                                <div class="main-friend-chat">
                                                                    <div class="media chat-messages">
                                                                        <a class="media-left photo-table" href="javascript:"><img class="media-object img-radius img-radius m-t-5" src="https://bootdey.com/img/Content/avatar/avatar1.png" alt="Generic placeholder image"></a>
                                                                        <div class="media-body chat-menu-content">
                                                                            <div class="">
                                                                                <p class="chat-cont">hello Datta! Will you tell me something</p>
                                                                                <p class="chat-cont">about yourself?</p>
                                                                            </div>
                                                                            <p class="chat-time">8:20 a.m.</p>
                                                                        </div>
                                                                    </div>
                                                                    <div class="media chat-messages">
                                                                        <div class="media-body chat-menu-reply">
                                                                            <div class="">
                                                                                <p class="chat-cont">Ohh! very nice</p>
                                                                            </div>
                                                                            <p class="chat-time">8:22 a.m.</p>
                                                                        </div>
                                                                    </div>
                                                                    <div class="media chat-messages">
                                                                        <a class="media-left photo-table" href="javascript:"><img class="media-object img-radius img-radius m-t-5" src="../assets/images/user/avatar-2.jpg" alt="Generic placeholder image"></a>
                                                                        <div class="media-body chat-menu-content">
                                                                            <div class="">
                                                                                <p class="chat-cont">can you help me?</p>
                                                                            </div>
                                                                            <p class="chat-time">8:20 a.m.</p>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            <div class="ps__rail-x" style="left: 0px; bottom: -99px;"><div class="ps__thumb-x" tabindex="0" style="left: 0px; width: 0px;"></div></div><div class="ps__rail-y" style="top: 99px; height: 84px; right: 0px;"><div class="ps__thumb-y" tabindex="0" style="top: 12px; height: 40px;"></div></div></div>
                                                        </div>
                                                        <hr>
                                                        <div class="msg-form">
                                                            <div class="input-group mb-0">
                                                                <input type="text" class="form-control msg-send-chat" placeholder="Text . . .">
                                                                <div class="input-group-append">
                                                                    <input type="file" id="imgupload" style="display:none">
                                                                    <button id="OpenImgUpload" class="btn btn-secondary btn-icon" type="button" data-toggle="tooltip" title="" data-original-title="file attachment"><i class="feather icon-paperclip"></i></button>
                                                                </div>
                                                                <div class="input-group-append">
                                                                    <button class="btn btn-theme btn-icon btn-msg-send" type="button"><i class="feather icon-play"></i></button>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!-- [ message ] 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.1.1 included, to get the result that you can see in the preview selection

body{margin-top:20px;}
/**  =====================
      Chatting css start
==========================  **/
.header-chat,
.header-user-list {
  height: 100%;
  width: 350px;
  position: fixed;
  top: 0;
  right: -350px;
  border-radius: 0;
  z-index: 1030;
  background-color: #fff;
  -webkit-transition: all 0.3s ease-in-out;
  transition: all 0.3s ease-in-out;
}
.header-chat .main-friend-cont,
.header-user-list .main-friend-cont {
  height: calc(100vh - 66px);
}
.header-chat .h-list-header,
.header-user-list .h-list-header {
  padding: 15px;
  border-bottom: 1px solid #f1f1f1;
}
.header-chat .h-list-body,
.header-user-list .h-list-body {
  padding: 20px 0;
}
.header-chat.open,
.header-user-list.open {
  -webkit-box-shadow: 0 1px 10px 0 rgba(69, 90, 100, 0.2);
          box-shadow: 0 1px 10px 0 rgba(69, 90, 100, 0.2);
  right: 0;
}

.header-user-list.open .h-close-text {
  position: absolute;
  top: 111px;
  left: -99px;
}
.header-user-list.open .h-close-text i {
  position: absolute;
  top: 23px;
  left: 73px;
  font-size: 25px;
  z-index: 1003;
  color: #1de9b6;
}
.header-user-list.open .h-close-text:after {
  content: "\61";
  font-family: "pct";
  z-index: 1001;
  font-size: 150px;
  line-height: 0;
  color: #fff;
  position: absolute;
  top: 35px;
  left: 6px;
  text-shadow: -4px 0 7px rgba(69, 90, 100, 0.12);
}
.header-user-list.open.msg-open:after {
  color: rgba(4, 169, 245, 0.1);
}

.h-list-header .form-control:active, .h-list-header .form-control:focus, .h-list-header .form-control:hover {
  -webkit-box-shadow: none;
          box-shadow: none;
  outline: none;
}

.h-list-body {
  position: relative;
}
.h-list-body .userlist-box {
  cursor: pointer;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  padding: 15px 20px;
  position: relative;
}
.h-list-body .userlist-box:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20px;
  width: calc(100% - 40px);
  height: 1px;
  background: #f3f4f9;
}
.h-list-body .userlist-box.active {
  background: #e0f5fe;
}
.h-list-body .userlist-box .media-left {
  padding-right: 10px;
}
.h-list-body .userlist-box .media-object {
  width: 50px;
  display: inline-block;
}
.h-list-body .userlist-box .chat-header {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 0;
}
.h-list-body .userlist-box .chat-header small {
  margin-top: 5px;
  font-size: 90%;
}
.h-list-body .userlist-box .live-status {
  height: 25px;
  width: 25px;
  position: absolute;
  top: 35px;
  right: 20px;
  border-radius: 100%;
  color: #fff;
  padding: 2px 0;
  text-align: center;
  background: linear-gradient(-135deg, #1de9b6 0%, #1dc4e9 100%);
}

.header-chat .h-list-header {
  text-align: center;
  position: relative;
}
.header-chat .h-list-header h6 {
  margin: 5px 0;
}
.header-chat .h-list-header .h-back-user-list {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  width: 40px;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  font-size: 20px;
}
.header-chat .main-chat-cont {
  height: calc(100vh - 166px);
}
.header-chat .h-list-body {
  height: 100%;
  background: #e0f5fe;
}
.header-chat .h-list-footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  right: 0;
  padding: 20px 15px;
  z-index: 10;
  background: #e0f5fe;
}
.header-chat .h-list-footer .input-group {
  background: #fff;
  border: none;
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.1);
          box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.1);
  padding: 7px;
  border-radius: 20px 0 10px 20px;
  width: calc(100% - 40px);
}
.header-chat .h-list-footer .input-group .form-control,
.header-chat .h-list-footer .input-group .input-group-text {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}
.header-chat .h-list-footer .input-group .btn-send:active, .header-chat .h-list-footer .input-group .btn-send:focus, .header-chat .h-list-footer .input-group .btn-send:hover,
.header-chat .h-list-footer .input-group .form-control:active,
.header-chat .h-list-footer .input-group .form-control:focus,
.header-chat .h-list-footer .input-group .form-control:hover {
  outline: none;
  -webkit-box-shadow: none;
          box-shadow: none;
}
.header-chat .h-list-footer .input-group .btn-attach {
  border-radius: 50%;
  padding: 5px;
  margin-right: 5px;
}
.header-chat .h-list-footer .input-group .btn-attach > i {
  margin-right: 0;
}
.header-chat .h-list-footer .input-group .btn-send {
  border-radius: 50%;
  padding: 10px;
  margin-left: 5px;
  position: absolute;
  right: -45px;
  top: 2px;
  z-index: 99;
}
.header-chat .h-list-footer .input-group .btn-send i {
  margin-right: 0;
}
.header-chat .h-list-footer .input-group .btn-send .input-group-text {
  color: #fff;
}
.header-chat .h-list-footer .input-group .form-control {
  -webkit-transition: all 0.3s ease-in-out;
  transition: all 0.3s ease-in-out;
  width: 0;
}
.header-chat .h-list-footer .input-group:after {
  content: "\67";
  font-family: "pct";
  z-index: 1001;
  font-size: 35px;
  line-height: 0;
  color: #fff;
  position: absolute;
  top: 18px;
  right: -23px;
  text-shadow: 4px 10px 20px rgba(0, 0, 0, 0.1);
}

.h-list-body .chat-messages {
  padding-bottom: 20px;
  padding-left: 15px;
  padding-right: 15px;
}
.h-list-body .chat-messages .photo-table {
  padding-right: 15px;
}
.h-list-body .chat-messages .photo-table img {
  display: inline-block;
  width: 50px;
  margin-bottom: 5px;
}
.h-list-body .chat-messages .chat-menu-content > div,
.h-list-body .chat-messages .chat-menu-reply > div {
  position: relative;
  overflow: visible;
  display: inline-block;
}
.h-list-body .chat-messages .chat-menu-content > div .chat-cont,
.h-list-body .chat-messages .chat-menu-reply > div .chat-cont {
  padding: 15px 20px;
}
.h-list-body .chat-messages .chat-menu-content .chat-time,
.h-list-body .chat-messages .chat-menu-reply .chat-time {
  margin: 9px 8px 0 10px;
}
.h-list-body .chat-messages .chat-menu-reply {
  text-align: right;
}
.h-list-body .chat-messages .chat-menu-reply > div p {
  background: #fff;
  border-radius: 4px;
  margin-bottom: 4px;
  margin-right: 25px;
  -webkit-box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.1);
          box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.1);
}
.h-list-body .chat-messages .chat-menu-reply > div p:first-child {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}
.h-list-body .chat-messages .chat-menu-reply > div p:last-child {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 0;
}
.h-list-body .chat-messages .chat-menu-reply > div:before {
  content: "\66";
  font-family: "pct";
  z-index: 5;
  font-size: 30px;
  line-height: 0;
  color: #fff;
  position: absolute;
  bottom: 19px;
  right: 5px;
  text-shadow: 7px 10px 20px rgba(0, 0, 0, 0.1);
}
.h-list-body .chat-messages .chat-menu-content > div p {
  background: linear-gradient(-135deg, #1de9b6 0%, #1dc4e9 100%);
  color: #fff;
  border-radius: 4px;
  margin-bottom: 4px;
  -webkit-box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.1);
          box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.1);
}
.h-list-body .chat-messages .chat-menu-content > div p:first-child {
  border-top-left-radius: 0;
  border-top-right-radius: 10px;
}
.h-list-body .chat-messages .chat-menu-content > div p:last-child {
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}
.h-list-body .chat-messages .chat-menu-content > div:before {
  content: "\68";
  font-family: "pct";
  z-index: 1001;
  font-size: 30px;
  line-height: 0;
  color: #1ec9de;
  position: absolute;
  top: 15px;
  left: -20px;
  text-shadow: -4px 4px 10px rgba(0, 0, 0, 0.15);
}

/* massage page start */
.msg-card .msg-user-list {
  height: calc(100vh - 300px);
}
.msg-card .msg-user-chat {
  background: #e0f5fe;
  height: calc(100vh - 330px);
  padding-top: 25px;
  padding-bottom: 25px;
  padding-left: 5px;
  padding-right: 5px;
}
.msg-card .msg-block > .row > div:before {
  content: "";
  width: 1px;
  height: 100%;
  background: #f1f1f1;
  position: absolute;
  top: 0;
}
.msg-card .msg-block > .row > div:first-child:before {
  right: 0;
}
.msg-card .msg-block > .row > div:last-child:before {
  left: -1px;
}

.main-friend-chat {
  padding-bottom: 15px;
}

@media screen and (max-width: 991px) {
  .msg-card .msg-block > .row > div:before {
    background: none;
  }
}

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

Similar snippets

Bootstrap example and template. bs4 simple chat app

bs4 simple chat app

Bootstrap example and template. bs4 timeline widget

bs4 timeline widget

Bootstrap example and template. bs4 social network layout

bs4 social network layout

Bootstrap example and template. bs4 seller cards

bs4 seller cards

Bootstrap example and template. bs5 edit profile account details

bs5 edit profile account details

Bootstrap example and template. chat app

chat app

Bootstrap example and template. bs4 Manage Addresses page

bs4 Manage Addresses page

Bootstrap example and template. Profile overview and edit

Profile overview and edit

Bootstrap example and template. bs4 chat with gradient bg

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 512 views, Using this bootstrap snippet you have the following benefits:

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