css - Align child to the right side of parent div like an chat app -


i have 3 div, want 2nd div on right chat app. how can achieve standard css or bootstrap. have tried pull-right messes layout shifting 3rd div , 2nd div top right.

<div>div1</div> <div class="pull-right">div2</div> <div>div3</div> 

screenshot

by using bootstrap can achieve

.child{border:2px solid #000; height:200px; margin:5px 0; min-width:100px; }
<!doctype html>  <html lang="en">  <head>    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>  </head>  <body>  <div class="container">  <div class="row">  <div class="col-md-4 child pull-left"></div>  </div>  <div class="row">  <div class="col-md-4 child pull-right"></div>  </div>  <div class="row">  <div class="col-md-4 child pull-left"></div>  </div>  </div>  </body>  </html>


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -