I am currently working on a chat application and have successfully implemented displaying the user's name along with the message in the chat box. However, I am facing issues with the design of the date and time display within the UI.
.userTextDivOp {
text-align: left;
float: left;
clear: both;
position: relative;
background: white;
padding-top: 5px;
padding-bottom: 7px;
padding-left: 7px;
padding-right: 7px;
border-radius: 6px;
border: 3px solid #999;
font-size: 12px;
margin-bottom: 7px;
margin-right: 4px;
margin-left: 4px;
}
.userTextDivOp::before {
content: '';
position: absolute;
visibility: visible;
top: -3px;
left: -11px;
border: 9px solid transparent;
border-top: 11px solid #999;
}
.userTextDivOp::after {
content: '';
position: absolute;
visibility: visible;
top: 0px;
left: -6px;
border: 9px solid transparent;
border-top: 8px solid white;
clear: both;
}
.userTextDivOp .message {
word-break: break-all;
font-size: 13px;
}
.userTextDivOp .username {
position: relative;
display: block;
font-weight: bold;
font-size: 14px;
color: #8e0035;
text-align: left;
padding-bottom: 4px;
margin-top: 3px;
}
.userTextDivOp .time {
position: absolute;
font-size: 14px;
color: #f60;
text-align: right;
}
<div class="userTextDivOp">
<span class="username">UserName</span>
<span class="message">' Testing testing</span>
<span class="time">04:00 PM 7 Jul 2016</span>
</div>