Trouble with chat layout - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Layout

Description

Trouble with chat layout

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
div.wrapper {<!--from  w  w  w .j  ava  2 s.c  o m-->
   position:relative;
   padding-bottom:0px;
   background-color:Chartreuse;
   z-index:-3;
}

div.wrapper img {
   position:absolute;
   bottom:0;
   right:0;
   border:2px solid yellow;
   width:41px;
   height:41px;
}

.sign-in {
   text-align:right;
   margin:0;
   margin-right:51px;
   padding:0;
}

p.talk-bubble {
   border:2px solid blue;
   padding:16px;
   background-color:pink;
   position:relative;
   margin-right:61px;
}

p.talk-bubble:before, p.talk-bubble:after {
   box-sizing:border-box;
   padding:0;
   content:'';
   width:21px;
   height:21px;
   display:block;
   position:absolute;
   border:21px solid OrangeRed;
}

p.talk-bubble:before {
   z-index:-2;
   border-bottom:21px solid grey;
   right:-13px;
   bottom:-2px;
}

p.talk-bubble:after {
   border-bottom:21px solid BlueViolet;
   right:-11px;
   bottom:0px;
}
</style> 
 </head> 
 <body> 
  <div class="wrapper"> 
   <p class="talk-bubble">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tem</p> 
   <p class="sign-in">Lorem ipsum dolor si</p> 
   <img src="https://www.java2s.com/style/demo/Google-Chrome.png"> 
  </div>  
 </body>
</html>

Related Tutorials