Is there a way to align the first div to the right without using float? I don't want the second div to be on the same line. My goal is to maintain the block level layout similar to chat applications. Any assistance would be highly appreciated. THANKS
Note: I am utilizing display inline-block to ensure that the divs fit the content properly.
.outer{
display: block;
}
.lbubble , .rbubble {
position: relative;
padding: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 2px 2px 10px 0px #616161;
box-shadow: 2px 2px 7px 0px #616161;
display: inline-block;
margin-bottom: 8px;
}
.lbubble{
background: lightblue;
}
.rbubble{
background: lightgreen;
}
.lbubble:after {
content: "";
position: absolute;
top: 5px;
left: -8px;
border-style: solid;
border-width: 10px 14px 10px 0;
border-color: transparent lightblue;
width: 0;
z-index: 1;
}
.rbubble:after {
content: "";
position: absolute;
top: 5px;
right: -8px;
border-style: solid;
border-width: 10px 0 10px 14px;
border-color: transparent lightgreen;
width: 0;
z-index: 1;
}
<div class='outer'> <div class="rbubble"> Right Bubble with align right</div> </div>
<div class='outer'> <div class="lbubble"> Left Bubble it should be on 2nd line with align left </div> </div>