css - HTML div comment box with arrow -


i trying create comment box arrow. using css, have problem cannot solve.

i have white background, , need make comment box white background. so, make box visible users, need put border box, don't know how put border arrow.

here css:

body {background: grey;padding: 40px}  .comment_div {     background: white;     width: 250px;     padding: 10px;     display: block; }  .pointer {     border: solid 20px transparent;     border-right-color: #fff;     position: absolute;     margin: 40px 0 0 -38px;     z-index: 999; } 

here html:

<div class="pointer"></div> <div class="comment_div">     test testtest testtest testtest testtest testtest testtest test     test testtest testtest testtest testtest testtest testtest test     test testtest testtest testtest testtest testtest testtest test     test testtest testtest testtest testtest testtest testtest test </div> 

here jsfiddle.

how can make border box below?

enter image description here

here solution, jsfiddle. hope can advantage of it.

.left {     width: 920px !important;     padding-bottom: 40px;     min-height: auto !important;     padding-right: 0;     float: left; }  .left > p:first-of-type {     background: #ffd987;     font-style: italic;     padding: 5px 10px;     margin-bottom: 40px; }  .tip {     background: #fff;     border: 1px solid #ccc;     padding: 10px;     font-size: 1.2em;     position: relative;     width: 200px; }  .tip:before {     position: absolute;     top: -14px;     left: 98px;     display: inline-block;     border-right: 14px solid transparent;     border-bottom: 14px solid #fff;     border-left: 14px solid transparent;     border-bottom-color: rgba(0, 0, 0, 0.2);     content: ''; }  .tip:after {     position: absolute;     top: -12px;     left: 99px;     display: inline-block;     border-right: 12px solid transparent;     border-bottom: 12px solid #fff;     border-left: 12px solid transparent;     content: ''; }  .tip.left:before {     border-top: 14px solid transparent;     border-right: 14px solid #fff;     border-bottom: 14px solid transparent;     border-right-color: rgba(0, 0, 0, 0.2);     left: -28px;     top: 20px; }  .tip.left:after {     border-top: 12px solid transparent;     border-right: 12px solid #fff;     border-bottom: 12px solid transparent;     left: -24px;     top: 22px; }  <div style="padding:50px">  <div class="tip left">     lorem ipsum dolor sit amet, consectetur adipiscing elit. nullam consectetur quam sapien egestas eget scelerisque lectus tempor. duis placerat tellus @ erat pellentesque nec ultricies erat molestie. integer nec orci id tortor molestie porta. suspendisse eu sagittis quam.     lorem ipsum dolor sit amet, consectetur adipiscing elit. nullam consectetur quam sapien egestas eget scelerisque lectus tempor. duis placerat tellus @ erat pellentesque nec ultricies erat molestie. integer nec orci id tortor molestie porta. suspendisse eu sagittis quam. </div> 


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -