JSFiddle - React, Tailwind, and code Playground
by Mubasshir Pawle
HTML
<ul class="chats">
<li class="in">
<img class="avatar" src="https://avatars2.githubusercontent.com/u/3141806?s=460&v=4" />
<p class="name">
Mubasshir Pwle
</p>
<p>
sdjh sdc kjsdc kjsdn
</p>
</li>
<li class="out">
<img class="avatar" src="https://avatars2.githubusercontent.com/u/3141806?s=460&v=4" />
<p class="name">
Mubasshir Pwle
</p>
<p>
sdjh sdc kjsdc kjsdn
</p>
</li>
</ul>
CSS
.chats {
margin: 0;
padding: 0;
margin-top: -15px;
}
.chats li {
list-style: none;
padding: 5px 0;
margin: 10px auto;
font-size: 12px;
}
.chats li img.avatar {
height: 45px;
width: 45px;
-webkit-border-radius: 50% !important;
-moz-border-radius: 50% !important;
border-radius: 50% !important;
}
.chats li.in img.avatar {
float: left;
margin-right: 10px;
}
.chats li .name {
color: #3590c1;
font-size: 13px;
font-weight: 400;
}
.chats li .datetime {
color: #333;
font-size: 13px;
font-weight: 400;
}
.chats li.out img.avatar {
float: right;
margin-left: 10px;
}
.chats li .message {
display: block;
padding: 5px;
position: relative;
}
.chats li.in .message {
text-align: left;
border-left: 2px solid #35aa47;
margin-left: 65px;
background: #fafafa
}
.chats li.in .message .arrow {
display: block;
position: absolute;
top: 5px;
left: -8px;
width: 0;
height: 0;
border-top: 8px solid transparent;
border-bottom: 8px solid transparent;
border-right: 8px solid #35aa47;
}
.chats li.out .message .arrow {
display: block;
position: absolute;
top: 5px;
right: -8px;
border-top: 8px solid transparent;
border-bottom: 8px solid transparent;
border-left: 8px solid #da4a38;
}
.chats li.out .message {
border-right: 2px solid #da4a38;
margin-right: 65px;
background: #fafafa;
text-align: right;
}
.chats li.out .name,
.chats li.out .datetime {
text-align: right;
}
.chats li .message .body {
display: block;
}
.chat-form {
margin-top: 15px;
padding: 10px;
background-color: #e9eff3;
overflow: hidden;
clear: both;
}
.chat-form .input-cont {
margin-right: 55px;
}
.chat-form .input-cont .m-wrap {
margin-bottom: 0px;
}
.chat-form .input-cont input {
border: 1px solid #ddd;
width: 100%;
margin-top: 0;
}
.chat-form .input-cont input {
background-color: #fff !important;
}
.chat-form .input-cont input:focus {
border: 1px solid #4b8df9 !important;
}
.chat-form...