HTML CSS examples for CSS Layout:Flex Align
Align the flex-item to left and right in flexbox
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .parent-div {<!--from w ww . j av a 2s . c o m--> display: -webkit-flex; display: flex; -webkit-flex-direction: row; flex-direction: row; white-space: nowrap; } .second-left-div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; -webkit-align-self: flex-start; align-self: flex-start; } .left-div { -webkit-align-self: flex-start; align-self: flex-start; } .right { margin-left: auto; white-space: nowrap; } .inside-right { display: inline-block; } </style> </head> <body> <div class="parent-div"> <div class="left-div"> Left div </div> <div class="second-left-div"> Test Test Test TEst test test </div> <div class="right"> <div class="inside-right"> 1st Right </div> <div class="inside-right"> 2nt Right </div> </div> </div> </body> </html>