I'm developing a chat using PHP, MySQL and jQuery.
My question is how can I make the users' messages stay on each side to differentiate?
Follow the PHP code:
echo "
<div class=\"row msg_container base_sent\">
<div class=\"col-md-10 col-xs-10\">
<div class=\"messages msg_sent\">
<p style=\"color: #303030\">$mensagem</p>
<time datetime=\"2009-11-13T20:00\" style=\"color: #303030\">$nick - $newHora</time>
</div>
</div>
<div class=\"col-md-2 col-xs-2 avatar\">
<img src=\"http://www.bitrebels.com/wp-content/uploads/2011/02/Original-Facebook-Geek-Profile-Avatar-1.jpg\" class=\"img-responsive\">
</div>
</div>";
I believe the image can help you understand what I want: